ogamesim-20130107/0000775000000000000000000000000012072357177012265 5ustar rootrootogamesim-20130107/www/0000775000000000000000000000000011056522520013074 5ustar rootrootogamesim-20130107/www/template/0000775000000000000000000000000011056521660014713 5ustar rootrootogamesim-20130107/www/template/sim.ru.html0000664000000000000000000004021210561431061017010 0ustar rootroot <TMPL_VAR title> [<TMPL_VAR cpu>xCPU detected]
Вставьте шпионский доклад
[Загрузить] <TMPL_VAR langid>
[Задание] Результаты
Наименование
Атакующий
[Защитник]
СРА СРЗ ЛРА ХРА ЛРЗ ХРЗ
Технологии
Флоты
Наземная оборона
Ресурсы
Металл Нужно ещё транспортов:
Кристалл Больших
Дейтерий Малых
Опции симулятора
Симуляции:
Статистика
Игрок Металл Кристалл Дейтерий
Атакующий
Защитник
Металл Кристалл Всего
Исключая оборону
Защита в обломки
Среднее Минимум Максимум
Переработчики
Исключая оборону
Защита в обломки
Симуляции
Раунды
Шанс образования луны
Исключая оборону
Защита в обломки
Победы Симуляции
Атакующий
Защитник
ogamesim-20130107/www/template/sim.cz.html0000664000000000000000000003666010702767602017024 0ustar rootroot <TMPL_VAR title> [<TMPL_VAR cpu>xCPU detected]
Vlož zprávu o špionáži
[stáhnout] <TMPL_VAR langid>
[Úkol] Výsledek
Jméno
Útočník
[Obránce]
PVÚ PVO LVÚ HVÚ LVO HVO
Technologie
Flotila
Obrana
Zdroje
Kov Je potřeba více nákladového prostoru.:
Krystaly Velký
Deuterium Malý
Nastavení Simulátoru
Simulace:
Statistiky
Hráč Kov Krystaly Deuterium
Útočník
Obránce
Kov Krystaly Celkem
Neobsahující obranu
Obsahující obranu
Průměr Minimum Maximum
Recyklátory
Neobsahující obranu
Obsahující obranu
Simulace
Kol
Šance na Měsíc
Neobsahující obranu
Obsahující obranu
Vyhrál Simulace
Útočník
Obránce
ogamesim-20130107/www/template/old.templates.tar.bz20000664000000000000000000001012610540207211020660 0ustar rootrootBZh91AY&SYP}CUp{b``(P* DM fC)h4 ='dL` 0 `#FѠ2da0FL& a F4a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񍌦mfg!82$`\mRyH0(RR,L%?AV5n9(NO)d@/0Ø$ I8iJR:Q88Á2sC*^`Q4fU4;Km565VMupiΕF9kVe}f݌b=1ȒN69&E(JQp7)JJRv}r|c}HwlQ`)Mʩ&MNOHM 6'I:pQEI^Y`>Nb#rr$0c| $5488)NCsRq2A09gMO*)0R``JR:ƽ{'8C YDrY`MĤIbTIH($LNt9&,tӯ>rc1LYmk 9N GNàӞY`PHBR% I2Iz8#ƔI";]t؜+?IT(uyϩA#M;  ? yEQŶқHX8R7'XqL >S>ՎH <TMPL_VAR title> [<TMPL_VAR cpu>xCPU detected]
Wklej raport szpiegowski
[pobierz] <TMPL_VAR langid>
[Zadanie] Wyniki
Nazwa
Agresor
[Obrońca]
ŚWA ŚWO NWA NGWA NWO NGWO
Technologie
Floty
Jednostki naziemne
Surowce
Metal Zapotrzebowanie na transportery:
Kryształ Duży
Deuter Mały
Opcje symulatora
Symulacje:
Statystyka
Gracz Metal Kryształ Deuter
Agresor
Obrońca
Metal Kryształ Całkowicie
Bez jednostek naziemnych
Wraz z naziemnymi
Średnio Minimum Maksimum
Recyklery
Bez jednostek naziemnych
Wraz z naziemnymi
Symulacje
Rundy
Szansa na księżyc
Bez jednostek naziemnych
Wraz z naziemnymi
Wygranych Symulacje
Agresor
Obrońca
ogamesim-20130107/www/template/sim.fr.html0000664000000000000000000003666210561431061017007 0ustar rootroot <TMPL_VAR title> [<TMPL_VAR cpu>xCPU detected]
Insérer rapport d'espionage
[télécharger] <TMPL_VAR langid>
[Tâche] Résultats
Nom
Attaquant
[Défenseur]
RMA RMD MRA PRA MRD PRD
Technologies
Flottes
Unités au sol
Ressources
Metal Prévoir cargos en plus:
Cristal Grand
Deutérium Petit
Paramétres de simulation
Simulations:
Statistiques
Joueur Metal Cristal Deutérium
Attaquant
Défenseur
Metal Cristal Total
Sans défense
Avec défense
Moyenne Minimum Maximum
Recycleurs
Sans défense
Avec défense
Simulations
Tours
Chance d'une lune
Sans défense
Avec défense
Victoires Simulations
Attaquant
Défenseur
ogamesim-20130107/www/template/sim.ca.html0000664000000000000000000003667310561431060016764 0ustar rootroot <TMPL_VAR title> [<TMPL_VAR cpu>xCPU detected]
Apega l'inform d'espionatje.
[Descarregar] <TMPL_VAR langid>
[Nou] Resultats
Nombre
Atacant
[Defensor]
VMRA VMRD MRA PRA MRD PRD
Tecnologies
Flotes
Defenses
Recursos
Metal Naus de carrega necesarias:
Cristall Grans
Deuteri Petites
Opcions
Simulacions:
Estadístiques
Jugador Metal Cristall Deuteri
Atacant
Defensor
Metal Cristall Total
Excluir defenses
Defenses als escombros
Promedi Mínim Máxim
Recicladors
Excluir defenses
Defenses als escombros
Simulacions
Rondes
Probabilitat deixir Lluna
Excluir defenses
Defenses als escombros
Victória Simulacions
Atacant
Defensor
ogamesim-20130107/www/template/lang/0000775000000000000000000000000011056521625015635 5ustar rootrootogamesim-20130107/www/template/lang/ru.po0000664000000000000000000000653110542014706016624 0ustar rootroot# Language file for Russian # Copyright (C) by Dmitry E. Oboukhov, 2006 # This file is distributed under the same license as the ogamesim package. # Dmitry E. Oboukhov # msgid "" msgstr "" "Project-Id-Version: 0.18\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2006-12-17 15:54\n" "PO-Revision-Date: 2006-12-14 01:45+0300\n" "Last-Translator: Dmitry E. Oboukhov \n" "Language-Team: Ogamesim language team \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" # msgid "Insert spy-report" msgstr "Вставьте шпионский доклад" # msgid "Next" msgstr "Далее" # msgid "download" msgstr "Загрузить" # msgid "New task" msgstr "Новое задание" # msgid "Task" msgstr "Задание" # msgid "Results" msgstr "Результаты" # msgid "Name" msgstr "Наименование" # msgid "Clean all" msgstr "Очистить все" # msgid "Restore all" msgstr "Восстановить все" # msgid "Save all" msgstr "Сохранить все" # msgid "Attacker" msgstr "Атакующий" # msgid "Clean" msgstr "Очистить" # msgid "Restore" msgstr "Восстановить" # msgid "Save" msgstr "Сохранить" # msgid "Insert data from spy-report" msgstr "Вставьте шпионский доклад" # msgid "Defender" msgstr "Защитник" # msgid "Average Attacker Results" msgstr "Средний результат атакующего" # msgid "AAR" msgstr "СРА" # msgid "Average Defender Results" msgstr "Средний результат защитника" # msgid "ADR" msgstr "СРЗ" # msgid "Best Attacker Results" msgstr "Лучший результат атакующего" # msgid "BAR" msgstr "ЛРА" # msgid "Worst Attacker Results" msgstr "Худший результат атакующего" # msgid "WAR" msgstr "ХРА" # msgid "Best Defender Results" msgstr "Лучший результат защитника" # msgid "BDR" msgstr "ЛРЗ" # msgid "Worst Defender Results" msgstr "Худший результат защитника" # msgid "WDR" msgstr "ХРЗ" # msgid "Technologies" msgstr "Технологии" # msgid "Fleets" msgstr "Флоты" # msgid "Ground units" msgstr "Наземная оборона" # msgid "Resources" msgstr "Ресурсы" # msgid "Metal" msgstr "Металл" # msgid "Needed more chargo space" msgstr "Нужно ещё транспортов" # msgid "Crystal" msgstr "Кристалл" # msgid "Large" msgstr "Больших" # msgid "Deuterium" msgstr "Дейтерий" # msgid "Small" msgstr "Малых" # msgid "Simulator options" msgstr "Опции симулятора" # msgid "Simulations" msgstr "Симуляции" # msgid "Statistics" msgstr "Статистика" # msgid "Gamer" msgstr "Игрок" # msgid "Total" msgstr "Всего" # msgid "Exclude ground" msgstr "Исключая оборону" # msgid "Include ground" msgstr "Защита в обломки" # msgid "Average" msgstr "Среднее" # msgid "Minimum" msgstr "Минимум" # msgid "Maximum" msgstr "Максимум" # msgid "Recyclers" msgstr "Переработчики" # msgid "Rounds" msgstr "Раунды" # msgid "Moon chance" msgstr "Шанс образования луны" # msgid "Wins" msgstr "Победы" ogamesim-20130107/www/template/lang/ca.po0000664000000000000000000000546510541311466016570 0ustar rootroot# Language file for Catalan # Copyright (C) by Dmitry E. Oboukhov, 2006 # This file is distributed under the same license as the ogamesim package. # Dmitry E. Oboukhov # msgid "" msgstr "" "Project-Id-Version: 0.18\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2006-12-17 15:54\n" "PO-Revision-Date: 2006-12-10 20:03+0100\n" "Last-Translator: Dark Raven \n" "Language-Team: Ogamesim language team \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" # msgid "Insert spy-report" msgstr "Apega l'inform d'espionatje." # msgid "Next" msgstr "Següent" # msgid "download" msgstr "Descarregar" # msgid "New task" msgstr "Llimpia els datos" # msgid "Task" msgstr "Nou" # msgid "Results" msgstr "Resultats" # msgid "Name" msgstr "Nombre" # msgid "Clean all" msgstr "Llimpiar Tot" # msgid "Restore all" msgstr "Restablir Tot" # msgid "Save all" msgstr "Salvar Tot" # msgid "Attacker" msgstr "Atacant" # msgid "Clean" msgstr "Limpiar" # msgid "Restore" msgstr "Restablir" # msgid "Save" msgstr "Salvar" # msgid "Insert data from spy-report" msgstr "Inserta l'informe d'espionatje" # msgid "Defender" msgstr "Defensor" # msgid "Average Attacker Results" msgstr "Valor Mitjà dels Resultats de l'Atacant" # msgid "AAR" msgstr "VMRA" # msgid "Average Defender Results" msgstr "Valor Mitjà dels Resultats del defensor" # msgid "ADR" msgstr "VMRD" # msgid "Best Attacker Results" msgstr "Millors Resultats de l'Atacant" # msgid "BAR" msgstr "MRA" # msgid "Worst Attacker Results" msgstr "Pitjors Resultats de l'Atacant" # msgid "WAR" msgstr "PRA" # msgid "Best Defender Results" msgstr "Millors Resultats del Defensor" # msgid "BDR" msgstr "MRD" # msgid "Worst Defender Results" msgstr "Pitjors Resultats del Defensor" # msgid "WDR" msgstr "PRD" # msgid "Technologies" msgstr "Tecnologies" # msgid "Fleets" msgstr "Flotes" # msgid "Ground units" msgstr "Defenses" # msgid "Resources" msgstr "Recursos" # msgid "Metal" msgstr "Metal" # msgid "Needed more chargo space" msgstr "Naus de carrega necesarias" # msgid "Crystal" msgstr "Cristall" # msgid "Large" msgstr "Grans" # msgid "Deuterium" msgstr "Deuteri" # msgid "Small" msgstr "Petites" # msgid "Simulator options" msgstr "Opcions" # msgid "Simulations" msgstr "Simulacions" # msgid "Statistics" msgstr "Estadístiques" # msgid "Gamer" msgstr "Jugador" # msgid "Total" msgstr "Total" # msgid "Exclude ground" msgstr "Excluir defenses" # msgid "Include ground" msgstr "Defenses als escombros" # msgid "Average" msgstr "Promedi" # msgid "Minimum" msgstr "Mínim" # msgid "Maximum" msgstr "Máxim" # msgid "Recyclers" msgstr "Recicladors" # msgid "Rounds" msgstr "Rondes" # msgid "Moon chance" msgstr "Probabilitat deixir Lluna" # msgid "Wins" msgstr "Victória" ogamesim-20130107/www/template/lang/cn.po0000664000000000000000000000523110734727312016601 0ustar rootroot# Language file for LANGUAGE # Copyright (C) by Dmitry E. Oboukhov, 2006 # This file is distributed under the same license as the ogamesim package. # Dmitry E. Oboukhov # #, fuzzy msgid "" msgstr "" "Project-Id-Version: 0.28\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2007-02-04 22:21\n" "PO-Revision-Date: 2007-12-23 04:08+8\n" "Last-Translator: Zowind \n" "Language-Team: Ogamesim language team \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" # msgid "Insert spy-report" msgstr "插入探测器报告" # msgid "Next" msgstr "开始模拟" # msgid "download" msgstr "下载" # msgid "New task" msgstr "新任务" # msgid "Task" msgstr "任务" # msgid "Results" msgstr "结果" # msgid "Name" msgstr "名字" # msgid "Clean all" msgstr "清除全部" # msgid "Restore all" msgstr "恢复全部" # msgid "Save all" msgstr "保存全部" # msgid "Attacker" msgstr "攻击者" # msgid "Clean" msgstr "清除" # msgid "Restore" msgstr "恢复" # msgid "Save" msgstr "保存" # msgid "Insert data from spy-report" msgstr "插入探测器报告数据" # msgid "Defender" msgstr "防守者" # msgid "Average Attacker Results" msgstr "平均攻击结果" # msgid "AAR" msgstr "AAR" # msgid "Average Defender Results" msgstr "平均防守结果" # msgid "ADR" msgstr "ADR" # msgid "Best Attacker Results" msgstr "最佳攻击结果" # msgid "BAR" msgstr "BAR" # msgid "Worst Attacker Results" msgstr "最差攻击结果" # msgid "WAR" msgstr "WAR" # msgid "Best Defender Results" msgstr "最佳防守结果" # msgid "BDR" msgstr "BDR" # msgid "Worst Defender Results" msgstr "最差防守结果" # msgid "WDR" msgstr "WDR" # msgid "Technologies" msgstr "技术" # msgid "Fleets" msgstr "舰队" # msgid "Ground units" msgstr "防御" # msgid "Resources" msgstr "资源" # msgid "Metal" msgstr "金属" # msgid "Needed more chargo space" msgstr "需要运输舰" # msgid "Crystal" msgstr "晶体" # msgid "Large" msgstr "大型" # msgid "Deuterium" msgstr "重氢" # msgid "Small" msgstr "小型" # msgid "Simulator options" msgstr "模拟选项" # msgid "Simulations" msgstr "模拟次数" # msgid "Statistics" msgstr "统计" # msgid "Gamer" msgstr "玩家" # msgid "Total" msgstr "总计" # msgid "Exclude ground" msgstr "不包括地面" # msgid "Include ground" msgstr "包括地面" # msgid "Average" msgstr "平均" # msgid "Minimum" msgstr "最小" # msgid "Maximum" msgstr "最大" # msgid "Recyclers" msgstr "回收" # msgid "Rounds" msgstr "回合" # msgid "Moon chance" msgstr "月球形成机率" # msgid "Wins" msgstr "胜利者" ogamesim-20130107/www/template/lang/sp.po0000664000000000000000000000552110541237041016614 0ustar rootroot# Language file for Spanish # Copyright (C) by Dmitry E. Oboukhov, 2006 # This file is distributed under the same license as the ogamesim package. # Dmitry E. Oboukhov # msgid "" msgstr "" "Project-Id-Version: 0.18\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2006-12-17 15:54\n" "PO-Revision-Date: 2006-12-10 20:03+0100\n" "Last-Translator: Dark Raven \n" "Language-Team: Ogamesim language team \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" # msgid "Insert spy-report" msgstr "Pega el informe de espionaje" # msgid "Next" msgstr "Siguiente" # msgid "download" msgstr "Descargar" # msgid "New task" msgstr "Limpia los datos" # msgid "Task" msgstr "Nuevo" # msgid "Results" msgstr "Resultados" # msgid "Name" msgstr "Nombre" # msgid "Clean all" msgstr "Limpiar Todo" # msgid "Restore all" msgstr "Restablecer Todo" # msgid "Save all" msgstr "Salvar Todo" # msgid "Attacker" msgstr "Atacante" # msgid "Clean" msgstr "Limpiar" # msgid "Restore" msgstr "Restablecer" # msgid "Save" msgstr "Salvar" # msgid "Insert data from spy-report" msgstr "Insertar datos del informe de espionaje" # msgid "Defender" msgstr "Defensor" # msgid "Average Attacker Results" msgstr "Valor Medio de los Resultados del Atacante" # msgid "AAR" msgstr "VMRA" # msgid "Average Defender Results" msgstr "Valor Medio de los Resultados del Defensor" # msgid "ADR" msgstr "VMRD" # msgid "Best Attacker Results" msgstr "Mejores Resultados del Atacante" # msgid "BAR" msgstr "MRA" # msgid "Worst Attacker Results" msgstr "Peores Resultados del Atacante" # msgid "WAR" msgstr "PRA" # msgid "Best Defender Results" msgstr "Mejores Resultados del Defensor" # msgid "BDR" msgstr "MRD" # msgid "Worst Defender Results" msgstr "Peores Resultados del Defensor" # msgid "WDR" msgstr "PRD" # msgid "Technologies" msgstr "Tecnologias" # msgid "Fleets" msgstr "Flotas" # msgid "Ground units" msgstr "Defensas" # msgid "Resources" msgstr "Recursos" # msgid "Metal" msgstr "Metal" # msgid "Needed more chargo space" msgstr "Naves de carga necesarias" # msgid "Crystal" msgstr "Cristal" # msgid "Large" msgstr "Grandes" # msgid "Deuterium" msgstr "Deuterio" # msgid "Small" msgstr "Pequeñas" # msgid "Simulator options" msgstr "Opciones" # msgid "Simulations" msgstr "Simulaciones" # msgid "Statistics" msgstr "Estadísticas" # msgid "Gamer" msgstr "Jugador" # msgid "Total" msgstr "Total" # msgid "Exclude ground" msgstr "Excluir defensas" # msgid "Include ground" msgstr "Defensas a los escombros" # msgid "Average" msgstr "Promedio" # msgid "Minimum" msgstr "Mínimo" # msgid "Maximum" msgstr "Máximo" # msgid "Recyclers" msgstr "Recicladores" # msgid "Rounds" msgstr "Rondas" # msgid "Moon chance" msgstr "Probabilidad de Luna" # msgid "Wins" msgstr "Victória" ogamesim-20130107/www/template/lang/de.po0000664000000000000000000000552710541237041016570 0ustar rootroot# Language file for LANGUAGE # Copyright (C) by Dmitry E. Oboukhov, 2006 # This file is distributed under the same license as the ogamesim package. # Dmitry E. Oboukhov # msgid "" msgstr "" "Project-Id-Version: 0.18\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2006-12-17 15:54\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Sergey Tarassenko \n" "Language-Team: Ogamesim language team \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" # msgid "Insert spy-report" msgstr "Spionage-Bericht einlesen" # msgid "Next" msgstr "Weiter" # msgid "download" msgstr "herunterladen" # msgid "New task" msgstr "Neue Aufgabe" # msgid "Task" msgstr "Aufgabe" # msgid "Results" msgstr "Ergebnisse" # msgid "Name" msgstr "Name" # msgid "Clean all" msgstr "Alles löschen" # msgid "Restore all" msgstr "Alles wiederherstellen" # msgid "Save all" msgstr "Alles speichern" # msgid "Attacker" msgstr "Angreifer" # msgid "Clean" msgstr "Löschen" # msgid "Restore" msgstr "Widerherstellen" # msgid "Save" msgstr "Speichern" # msgid "Insert data from spy-report" msgstr "Daten aus Spionagebericht einlesen" # msgid "Defender" msgstr "Verteidiger" # msgid "Average Attacker Results" msgstr "Mittlere Angreiferergebnisse" # msgid "AAR" msgstr "MAE" # msgid "Average Defender Results" msgstr "Mittlere Verteidigergebnisse" # msgid "ADR" msgstr "MVE" # msgid "Best Attacker Results" msgstr "Beste Angreiferergebnisse" # msgid "BAR" msgstr "BAE" # msgid "Worst Attacker Results" msgstr "Schlechteste Angreiferergebnisse" # msgid "WAR" msgstr "SAE" # msgid "Best Defender Results" msgstr "Beste Verteidigerergebnisse" # msgid "BDR" msgstr "BVE" # msgid "Worst Defender Results" msgstr "Schlechteste Verteidigerergebnisse" # msgid "WDR" msgstr "SVE" # msgid "Technologies" msgstr "Forschungen" # msgid "Fleets" msgstr "Flotte" # msgid "Ground units" msgstr "Verteidigung" # msgid "Resources" msgstr "Ressourcen" # msgid "Metal" msgstr "Metall" # msgid "Needed more chargo space" msgstr "Transporte nötig" # msgid "Crystal" msgstr "Kristall" # msgid "Large" msgstr "Große" # msgid "Deuterium" msgstr "Deuterium" # msgid "Small" msgstr "Kleine" # msgid "Simulator options" msgstr "Simulator Optionen" # msgid "Simulations" msgstr "Simulationen" # msgid "Statistics" msgstr "Statistik" # msgid "Gamer" msgstr "Spieler" # msgid "Total" msgstr "Insgesamt" # msgid "Exclude ground" msgstr "Verteidigung ausschließen" # msgid "Include ground" msgstr "Verteidigung ins Trümmerfeld" # msgid "Average" msgstr "Mittlere" # msgid "Minimum" msgstr "Minimale" # msgid "Maximum" msgstr "Maximale" # msgid "Recyclers" msgstr "Recycler" # msgid "Rounds" msgstr "Runden" # msgid "Moon chance" msgstr "Chance einer Mondentstehung" # msgid "Wins" msgstr "Gewinne" ogamesim-20130107/www/template/lang/NEW_LANGUAGE_TEMPLATE.pot0000664000000000000000000000426110561431060021544 0ustar rootroot# Language file for LANGUAGE # Copyright (C) by Dmitry E. Oboukhov, 2006 # This file is distributed under the same license as the ogamesim package. # Dmitry E. Oboukhov # #, fuzzy msgid "" msgstr "" "Project-Id-Version: 0.28\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2007-02-04 22:21\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: Ogamesim language team \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" # msgid "Insert spy-report" msgstr "" # msgid "Next" msgstr "" # msgid "download" msgstr "" # msgid "New task" msgstr "" # msgid "Task" msgstr "" # msgid "Results" msgstr "" # msgid "Name" msgstr "" # msgid "Clean all" msgstr "" # msgid "Restore all" msgstr "" # msgid "Save all" msgstr "" # msgid "Attacker" msgstr "" # msgid "Clean" msgstr "" # msgid "Restore" msgstr "" # msgid "Save" msgstr "" # msgid "Insert data from spy-report" msgstr "" # msgid "Defender" msgstr "" # msgid "Average Attacker Results" msgstr "" # msgid "AAR" msgstr "" # msgid "Average Defender Results" msgstr "" # msgid "ADR" msgstr "" # msgid "Best Attacker Results" msgstr "" # msgid "BAR" msgstr "" # msgid "Worst Attacker Results" msgstr "" # msgid "WAR" msgstr "" # msgid "Best Defender Results" msgstr "" # msgid "BDR" msgstr "" # msgid "Worst Defender Results" msgstr "" # msgid "WDR" msgstr "" # msgid "Technologies" msgstr "" # msgid "Fleets" msgstr "" # msgid "Ground units" msgstr "" # msgid "Resources" msgstr "" # msgid "Metal" msgstr "" # msgid "Needed more chargo space" msgstr "" # msgid "Crystal" msgstr "" # msgid "Large" msgstr "" # msgid "Deuterium" msgstr "" # msgid "Small" msgstr "" # msgid "Simulator options" msgstr "" # msgid "Simulations" msgstr "" # msgid "Statistics" msgstr "" # msgid "Gamer" msgstr "" # msgid "Total" msgstr "" # msgid "Exclude ground" msgstr "" # msgid "Include ground" msgstr "" # msgid "Average" msgstr "" # msgid "Minimum" msgstr "" # msgid "Maximum" msgstr "" # msgid "Recyclers" msgstr "" # msgid "Rounds" msgstr "" # msgid "Moon chance" msgstr "" # msgid "Wins" msgstr "" ogamesim-20130107/www/template/lang/cz.po0000664000000000000000000000546310702767220016621 0ustar rootroot# Language file for LANGUAGE # Copyright (C) by Dmitry E. Oboukhov, 2006 # This file is distributed under the same license as the ogamesim package. # Dmitry E. Oboukhov # #, fuzzy msgid "" msgstr "" "Project-Id-Version: 0.28\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2007-02-04 22:21\n" "PO-Revision-Date: 2007-10-09 01:00+1\n" "Last-Translator: cyscorba \n" "Language-Team: Ogamesim language team \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" # msgid "Insert spy-report" msgstr "Vlož zprávu o špionáži" # msgid "Next" msgstr "Další" # msgid "download" msgstr "stáhnout" # msgid "New task" msgstr "Nový úkol" # msgid "Task" msgstr "Úkol" # msgid "Results" msgstr "Výsledek" # msgid "Name" msgstr "Jméno" # msgid "Clean all" msgstr "Vše vymazat" # msgid "Restore all" msgstr "Vše obnovit" # msgid "Save all" msgstr "Vše uložit" # msgid "Attacker" msgstr "Útočník" # msgid "Clean" msgstr "Vymaž" # msgid "Restore" msgstr "Obnov" # msgid "Save" msgstr "Ulož" # msgid "Insert data from spy-report" msgstr ""Vlož data ze Zprávy o špionáži" # msgid "Defender" msgstr "Obránce" # msgid "Average Attacker Results" msgstr "Průměrný Výsledek Útočníka" # msgid "AAR" msgstr "PVÚ" # msgid "Average Defender Results" msgstr "Průměrný Výsledek Obránce" # msgid "ADR" msgstr "PVO" # msgid "Best Attacker Results" msgstr "Nejlepší Výsledek Útočníka" # msgid "BAR" msgstr "LVÚ" # msgid "Worst Attacker Results" msgstr "Nejhorší Výsledek Útočníka" # msgid "WAR" msgstr "HVÚ" # msgid "Best Defender Results" msgstr "Nejlepší Výsledek Obránce" # msgid "BDR" msgstr "LVO" # msgid "Worst Defender Results" msgstr "Nejhorší Výsledek Obránce" # msgid "WDR" msgstr "HVO" # msgid "Technologies" msgstr "Technologie" # msgid "Fleets" msgstr "Flotila" # msgid "Ground units" msgstr "Obrana" # msgid "Resources" msgstr "Zdroje" # msgid "Metal" msgstr "Kov" # msgid "Needed more chargo space" msgstr "Je potřeba více nákladového prostoru." # msgid "Crystal" msgstr "Krystaly" # msgid "Large" msgstr "Velký" # msgid "Deuterium" msgstr "Deuterium" # msgid "Small" msgstr "Malý" # msgid "Simulator options" msgstr "Nastavení Simulátoru" # msgid "Simulations" msgstr "Simulace" # msgid "Statistics" msgstr "Statistiky" # msgid "Gamer" msgstr "Hráč" # msgid "Total" msgstr "Celkem" # msgid "Exclude ground" msgstr "Neobsahující obranu" # msgid "Include ground" msgstr "Obsahující obranu" # msgid "Average" msgstr "Průměr" # msgid "Minimum" msgstr "Minimum" # msgid "Maximum" msgstr "Maximum" # msgid "Recyclers" msgstr "Recyklátory" # msgid "Rounds" msgstr "Kol" # msgid "Moon chance" msgstr "Šance na Měsíc" # msgid "Wins" msgstr "Vyhrál" ogamesim-20130107/www/template/lang/fr.po0000664000000000000000000000546010541237041016603 0ustar rootroot# Language file for FRENCH # Copyright (C) by Dmitry E. Oboukhov, 2006 # This file is distributed under the same license as the ogamesim package. # Dmitry E. Oboukhov # msgid "" msgstr "" "Project-Id-Version: 0.18\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2006-12-17 15:54\n" "PO-Revision-Date: 2006-12-15 21:15+1\n" "Last-Translator: MUNDO \n" "Language-Team: Ogamesim language team \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" # msgid "Insert spy-report" msgstr "Insérer rapport d'espionage" # msgid "Next" msgstr "Lancer" # msgid "download" msgstr "télécharger" # msgid "New task" msgstr "Nouvelle tâche" # msgid "Task" msgstr "Tâche" # msgid "Results" msgstr "Résultats" # msgid "Name" msgstr "Nom" # msgid "Clean all" msgstr "Effacer tout" # msgid "Restore all" msgstr "Remettre tout" # msgid "Save all" msgstr "Sauver tout" # msgid "Attacker" msgstr "Attaquant" # msgid "Clean" msgstr "Effacer" # msgid "Restore" msgstr "Remettre" # msgid "Save" msgstr "Sauver" # msgid "Insert data from spy-report" msgstr "Insérer les données du rapport d'espionnage" # msgid "Defender" msgstr "Défenseur" # msgid "Average Attacker Results" msgstr "Resultat Moyen pour l'Attaquant" # msgid "AAR" msgstr "RMA" # msgid "Average Defender Results" msgstr "Résultat Moyen pour le Defenseur" # msgid "ADR" msgstr "RMD" # msgid "Best Attacker Results" msgstr "Meileur Résultat pour l'Attaquant" # msgid "BAR" msgstr "MRA" # msgid "Worst Attacker Results" msgstr "Pire Résultat pour l'Attaquant" # msgid "WAR" msgstr "PRA" # msgid "Best Defender Results" msgstr "Meilleur Résultat Défenseur" # msgid "BDR" msgstr "MRD" # msgid "Worst Defender Results" msgstr "Pire Résultat pour le Défenseur" # msgid "WDR" msgstr "PRD" # msgid "Technologies" msgstr "Technologies" # msgid "Fleets" msgstr "Flottes" # msgid "Ground units" msgstr "Unités au sol" # msgid "Resources" msgstr "Ressources" # msgid "Metal" msgstr "Metal" # msgid "Needed more chargo space" msgstr "Prévoir cargos en plus" # msgid "Crystal" msgstr "Cristal" # msgid "Large" msgstr "Grand" # msgid "Deuterium" msgstr "Deutérium" # msgid "Small" msgstr "Petit" # msgid "Simulator options" msgstr "Paramétres de simulation" # msgid "Simulations" msgstr "Simulations" # msgid "Statistics" msgstr "Statistiques" # msgid "Gamer" msgstr "Joueur" # msgid "Total" msgstr "Total" # msgid "Exclude ground" msgstr "Sans défense" # msgid "Include ground" msgstr "Avec défense" # msgid "Average" msgstr "Moyenne" # msgid "Minimum" msgstr "Minimum" # msgid "Maximum" msgstr "Maximum" # msgid "Recyclers" msgstr "Recycleurs" # msgid "Rounds" msgstr "Tours" # msgid "Moon chance" msgstr "Chance d'une lune" # msgid "Wins" msgstr "Victoires" ogamesim-20130107/www/template/lang/pl.po0000664000000000000000000000545111056521625016615 0ustar rootroot# Language file for Polish # Copyright (C) by Dmitry E. Oboukhov, 2006 # This file is distributed under the same license as the ogamesim package. # Dmitry E. Oboukhov # #, fuzzy msgid "" msgstr "" "Project-Id-Version: 0.28\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2007-02-04 22:21\n" "PO-Revision-Date: 2008-08-28 17:11+0100\n" "Last-Translator: Sophisticated \n" "Language-Team: Ogamesim language team \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" # msgid "Insert spy-report" msgstr "Wklej raport szpiegowski" # msgid "Next" msgstr "Następny" # msgid "download" msgstr "pobierz" # msgid "New task" msgstr "Nowe zadanie" # msgid "Task" msgstr "Zadanie" # msgid "Results" msgstr "Wyniki" # msgid "Name" msgstr "Nazwa" # msgid "Clean all" msgstr "Wyczyść wszystko" # msgid "Restore all" msgstr "Przywróć wszystko" # msgid "Save all" msgstr "Zapisz wszystko" # msgid "Attacker" msgstr "Agresor" # msgid "Clean" msgstr "Czyść" # msgid "Restore" msgstr "Przywróć" # msgid "Save" msgstr "Zapisz" # msgid "Insert data from spy-report" msgstr "Wklej treść raportu szpiegowskiego" # msgid "Defender" msgstr "Obrońca" # msgid "Average Attacker Results" msgstr "Średni Wynik Agresora" # msgid "AAR" msgstr "ŚWA" # msgid "Average Defender Results" msgstr "Średni Wynik Obrońcy" # msgid "ADR" msgstr "ŚWO" # msgid "Best Attacker Results" msgstr "Najlepszy Wynik Agresora" # msgid "BAR" msgstr "NWA" # msgid "Worst Attacker Results" msgstr "Najgorszy Wynik Agresora" # msgid "WAR" msgstr "NGWA" # msgid "Best Defender Results" msgstr "Najlepszy Wynik Obrońcy" # msgid "BDR" msgstr "NWO" # msgid "Worst Defender Results" msgstr "Najgorszy Wynik Obrońcy" # msgid "WDR" msgstr "NGWO" # msgid "Technologies" msgstr "Technologie" # msgid "Fleets" msgstr "Floty" # msgid "Ground units" msgstr "Jednostki naziemne" # msgid "Resources" msgstr "Surowce" # msgid "Metal" msgstr "Metal" # msgid "Needed more chargo space" msgstr "Zapotrzebowanie na transportery" # msgid "Crystal" msgstr "Kryształ" # msgid "Large" msgstr "Duży" # msgid "Deuterium" msgstr "Deuter" # msgid "Small" msgstr "Mały" # msgid "Simulator options" msgstr "Opcje symulatora" # msgid "Simulations" msgstr "Symulacje" # msgid "Statistics" msgstr "Statystyka" # msgid "Gamer" msgstr "Gracz" # msgid "Total" msgstr "Całkowicie" # msgid "Exclude ground" msgstr "Bez jednostek naziemnych" # msgid "Include ground" msgstr "Wraz z naziemnymi" # msgid "Average" msgstr "Średnio" # msgid "Minimum" msgstr "Minimum" # msgid "Maximum" msgstr "Maksimum" # msgid "Recyclers" msgstr "Recyklery" # msgid "Rounds" msgstr "Rundy" # msgid "Moon chance" msgstr "Szansa na księżyc" # msgid "Wins" msgstr "Wygranych" ogamesim-20130107/www/template/sim.sp.html0000664000000000000000000003674110561431061017020 0ustar rootroot <TMPL_VAR title> [<TMPL_VAR cpu>xCPU detected]
Pega el informe de espionaje
[Descargar] <TMPL_VAR langid>
[Nuevo] Resultados
Nombre
Atacante
[Defensor]
VMRA VMRD MRA PRA MRD PRD
Tecnologias
Flotas
Defensas
Recursos
Metal Naves de carga necesarias:
Cristal Grandes
Deuterio Pequeñas
Opciones
Simulaciones:
Estadísticas
Jugador Metal Cristal Deuterio
Atacante
Defensor
Metal Cristal Total
Excluir defensas
Defensas a los escombros
Promedio Mínimo Máximo
Recicladores
Excluir defensas
Defensas a los escombros
Simulaciones
Rondas
Probabilidad de Luna
Excluir defensas
Defensas a los escombros
Victória Simulaciones
Atacante
Defensor
ogamesim-20130107/www/template/sim.en.html0000664000000000000000000003643010561431061016773 0ustar rootroot <TMPL_VAR title> [<TMPL_VAR cpu>xCPU detected]
Insert spy-report
[download] <TMPL_VAR langid>
[Task] Results
Name
Attacker
[Defender]
AAR ADR BAR WAR BDR WDR
Technologies
Fleets
Ground units
Resources
Metal Needed more chargo space:
Crystal Large
Deuterium Small
Simulator options
Simulations:
Statistics
Gamer Metal Crystal Deuterium
Attacker
Defender
Metal Crystal Total
Exclude ground
Include ground
Average Minimum Maximum
Recyclers
Exclude ground
Include ground
Simulations
Rounds
Moon chance
Exclude ground
Include ground
Wins Simulations
Attacker
Defender
ogamesim-20130107/www/template/sim.cn.html0000664000000000000000000003641110734727330017001 0ustar rootroot <TMPL_VAR title> [<TMPL_VAR cpu>xCPU detected]
插入探测器报告
[下载] <TMPL_VAR langid>
[任务] 结果
名字
攻击者
[防守者]
AAR ADR BAR WAR BDR WDR
技术
舰队
防御
资源
金属 需要运输舰:
晶体 大型
重氢 小型
模拟选项
模拟次数:
统计
玩家 金属 晶体 重氢
攻击者
防守者
金属 晶体 总计
不包括地面
包括地面
平均 最小 最大
回收
不包括地面
包括地面
模拟次数
回合
月球形成机率
不包括地面
包括地面
胜利者 模拟次数
攻击者
防守者
ogamesim-20130107/www/template/sim.de.html0000664000000000000000000003702510561431061016762 0ustar rootroot <TMPL_VAR title> [<TMPL_VAR cpu>xCPU detected]
Spionage-Bericht einlesen
[herunterladen] <TMPL_VAR langid>
[Aufgabe] Ergebnisse
Name
Angreifer
[Verteidiger]
MAE MVE BAE SAE BVE SVE
Forschungen
Flotte
Verteidigung
Ressourcen
Metall Transporte nötig:
Kristall Große
Deuterium Kleine
Simulator Optionen
Simulationen:
Statistik
Spieler Metall Kristall Deuterium
Angreifer
Verteidiger
Metall Kristall Insgesamt
Verteidigung ausschließen
Verteidigung ins Trümmerfeld
Mittlere Minimale Maximale
Recycler
Verteidigung ausschließen
Verteidigung ins Trümmerfeld
Simulationen
Runden
Chance einer Mondentstehung
Verteidigung ausschließen
Verteidigung ins Trümmerfeld
Gewinne Simulationen
Angreifer
Verteidiger
ogamesim-20130107/www/template/TEMPLATE.html0000664000000000000000000003762710561431054017030 0ustar rootroot <TMPL_VAR title> [<TMPL_VAR cpu>xCPU detected]
Insert spy-report
[download] <TMPL_VAR langid>
[Task] Results
Name
Attacker
[Defender]
AAR ADR BAR WAR BDR WDR
Technologies
Fleets
Ground units
Resources
Metal Needed more chargo space:
Crystal Large
Deuterium Small
Simulator options
Simulations:
Statistics
Gamer Metal Crystal Deuterium
Attacker
Defender
Metal Crystal Total
Exclude ground
Include ground
Average Minimum Maximum
Recyclers
Exclude ground
Include ground
Simulations
Rounds
Moon chance
Exclude ground
Include ground
Wins Simulations
Attacker
Defender
ogamesim-20130107/www/sim.js0000664000000000000000000000525210561425177014240 0ustar rootroot// открывает окошко репорта function create_window_for_get_report(url, lang) { url+='?lang='+lang; url+='&get_report=1'; window.open(url, '', 'width=640, height=480, location=no, '+ 'menubar=no, scrollbars=yes, status=no, '+ 'toolbar=no, resizable=no'); } // читает кукис function get_cookie( name ) { var start = document.cookie.indexOf( name + "=" ); var len = start + name.length + 1; if ( ( !start ) && ( name != document.cookie.substring( 0, name.length ) ) ) { return ''; } if ( start == -1 ) return ''; var end = document.cookie.indexOf( ";", len ); if ( end == -1 ) end = document.cookie.length; return unescape( document.cookie.substring( len, end ) ); } // записать кук function set_cookie(name, value) { cookie = name + "=" + escape(value) + '; expires=Sunday, 17-Jan-2038 00:00:00 GMT'; document.cookie = cookie; } // сохраняет игрока function save_gamer(prefix) { els=document.getElementsByTagName('input'); cookie=''; for (i=0; i0; i--) { pletters[pletters.length]=letters[i]; if (++gr==3) { pletters[pletters.length]='.'; gr=0; } } pletters[pletters.length]=letters[0]; for (i=pletters.length-1; i>=0; i--) { document.write(''); } } ogamesim-20130107/www/Makefile0000664000000000000000000000215510540205253014535 0ustar rootrootPOSRC = $(wildcard template/lang/*.po) LANGS = $(POSRC:template/lang/%.po=%) HTMLS = $(LANGS:%=template/sim.%.html) TEMPLATE = template/lang/NEW_LANGUAGE_TEMPLATE.pot MAINHTML = template/TEMPLATE.html VERSION = $(shell grep '^our \$$VERSION=' index.cgi \ |sed 's/^.*VERSION=//' \ |sed 's/;//' | sed 's/ //g') all: $(TEMPLATE) $(POSRC) $(HTMLS) template/sim.en.html $(TEMPLATE): $(MAINHTML) Makefile umask 022; \ perl mlhtml/htmlgettext.pl \ -sv $(VERSION) \ -package ogamesim \ -charset UTF-8 \ -langteam 'Ogamesim language team ' \ -desc 'Language file for LANGUAGE' \ -copyright \ 'Copyright (C) by Dmitry E. Oboukhov, 2006' \ -email 'Dmitry E. Oboukhov ' \ -o $@ $< $(POSRC): template/lang/%.po: $(TEMPLATE) msgmerge --suffix=.previous --update $@ $< $(HTMLS): template/sim.%.html:template/lang/%.po $(MAINHTML) Makefile umask 022; \ perl mlhtml/htmlputtext.pl -p $< \ -o $@ \ -charset UTF-8 \ $(MAINHTML) template/sim.en.html:$(MAINHTML) umask 022; \ perl mlhtml/htmlputtext.pl -o $@ \ -charset UTF-8 \ $(MAINHTML) 2>/dev/null .PHONY: all ogamesim-20130107/www/css/0000775000000000000000000000000010547556457013710 5ustar rootrootogamesim-20130107/www/css/base.css0000664000000000000000000001224110471611756015322 0ustar rootroot., #, td, th, textarea, body, table { font-family : Tahoma,sans-serif; font-size : 11px; } img { border : 0px; } p table { border : 0px; } p td { text-align : center; font-size : 11px; font-family : Tahoma,sans-serif; } table table { border : 0px; } table table td { font-size : 11px; font-family : Tahoma,sans-serif; } body { color : #E6EBFB; margin-top : 1px; margin-left : 1px; background : #344055; background-image : url(../img/background.jpg); background-attachment: fixed; background-repeat : no-repeat; background-position : top; scrollbar-arrow-color: #E6EBFB; scrollbar-base-color: #344566; scrollbar-track-color: #344566; scrollbar-face-color: #344566; scrollbar-highlight-color: #344566; scrollbar-3dlight-color: #465673; scrollbar-darkshadow-color: #344566; scrollbar-shadow-color: #465673; font-size : 11px; font-family : Tahoma,sans-serif; } body form table th table input { width: 60px; } th, td.a, td.b, td.c, td.f, input, select, td.g, td.h, td.i, td.j, td.k, td.l, td.m, td.n, td.o, td.q, td.r, td.v, .style td, textarea, p td, table.s th img { border : 1px #415680 solid; font-size : 11px; font-family : Tahoma,sans-serif; } th, td.a, td.b, td.c, td.f, input, select, td.g, td.h, td.i, td.j, td.k, td.m, td.o, td.q, td.r, td.v, td.s, .style td, p td { background-color : #344566; } th { text-align : center; padding-left : 3px; padding-right : 3px; } td.a { height : 39px; text-align : center; } td.b { padding : 3px; } td.c { font-weight : bold; color : #E6EBFB; padding-left : 3px; background-image : url(../img/bg1.gif); } td.f, input, select, textarea { color : #E6EBFB; background-color : #344566; } textarea { width : 100%; } td.k input { text-align : left; } td.g { font-weight : bold; text-align : right; color : #E6EBFB; } td.h { text-align : center; color : #E6EBFB; } td.i { text-align : center; color : #E6EBFB; } td.j { text-align : center; color : #E6EBFB; } td.k, td.k input { text-align : center; color : #E6EBFB; } td.l { background-color : #344566; color : #E6EBFB; vertical-align : top; padding : 3px; background-image : url(img/bg2.gif); } td.m { font-weight : bold; text-align : right; width : 86px; color : #E6EBFB; } td.n { font-weight : bold; text-align : right; width : 89px; text-align : center; color : #E6EBFB; } td.o { text-align : center; color : #E6EBFB; } td.q { font-weight : bold; font-size : 11px; font-family : Tahoma,sans-serif; text-align : center; vertical-align : middle; color : #E6EBFB; } td.r { text-align : right; color : #E6EBFB; } td.v { font-weight : bold; text-align : right; color : #f7f7f7; } td.s { color : #E6EBFB; } table.s th { border : 0px; } table.s th img { width : 89px; height : 89px; } div.z { font-weight : bold; color : #E6EBFB; } a { color : #E6EBFB; text-decoration : none; font-weight : bold; } a.s { color : #E6EBFB; } a.t { color : #E6EBFB; } a:hover { color : #CDD7F8; text-decoration : underline; } .style td { color : #E6EBFB; border-top : 0px; font-size : 11px; font-family : Tahoma,sans-serif; } .style div a { height : 100%; width : 100%; color : #f2f2f2; font-size : 11px; font-family : Tahoma,sans-serif; } .style div a:link { height : 100%; width : 100%; color : #f2f2f2; font-size : 11px; font-family : Tahoma,sans-serif; } .style div a:visited { height : 100%; width : 100%; color : #f2f2f2; font-size : 11px; font-family : Tahoma,sans-serif; } .style div a:hover { background-color : #415680; height : 100%; width : 100%; text-decoration : none; font-size : 11px; font-family : Tahoma,sans-serif; color : #E6EBFB; } .style { margin-top : 15px; } h1 { font-size : 11px; font-family : Tahoma,sans-serif; border-bottom : 0px #344566; solid; width : 98%; text-align : center; } ogamesim-20130107/www/CGI/0000775000000000000000000000000010562664446013515 5ustar rootrootogamesim-20130107/www/CGI/Counter.pm0000664000000000000000000000475410562664446015504 0ustar rootroot#!/usr/bin/perl use warnings; use strict; package CGI::Counter; our $VERSION=1.0; our @ISA='Exporter'; our @EXPORT=qw(new value inc); require Exporter; sub new($$) { my ($class_name, $file_name)=@_; defined $file_name or die __PACKAGE__ . " constructor must known counter file name"; bless {file=>$file_name}, $class_name; } sub load_counter($) { my ($self)=@_; unless (-f $self->{file}) { $self->{counter}=0; return; } open my $counter_file, '<', $self->{file} or die "Can not open file '$self->{file}': $!"; flock $counter_file, 2; my $value=<$counter_file>; $self->{counter}=0; defined $value or return; $value=~/(\d+)/ and $self->{counter}=$1; } sub inc($) { my ($self)=@_; my $cf; unless (-f $self->{file}) { open $cf, ">", $self->{file} or die "Can not create file '$self->{file}': $!"; flock $cf, 2; print $cf "0\n"; } else { open $cf, "+<", $self->{file} or die "Can not open file '$self->{file}': $!"; flock $cf, 2; } seek $cf, 0, 0; $self->{counter}=<$cf>; defined $self->{counter} or $self->{couter}=0; $self->{couter}=~s/\s+//g; $self->{counter}++; seek $cf, 0, 0; print $cf "$self->{counter}\n"; } sub value($) { my ($self)=@_; defined $self->{counter} or $self->load_counter; $self->{counter}; } __END__ =pod =head1 NAME CGI::Counter - This is easy counter for CGI scripts =head1 SYNOPSYS use CGI::Counter; my $counter=CGI::Counter('file_counter'); print $counter->value, "\n"; $counter->inc; print $counter->value, "\n"; =head1 METHODS B - Constructor; B - increment counter; B - return counter value. =head1 AUTHOR B Edimka@avanto.orgE =head1 COPYRIGHT Copyright (C) B Edimka@avanto.orgE This program is free software; you can redistribute it and/or modify it under the terms of the B as published by the Free Software Foundation; version 2 of the License This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA =head1 SCRIPT CATEGORIES CGI =head1 OSNAMES any =cut ogamesim-20130107/www/spool/0000775000000000000000000000000011056522520014230 5ustar rootrootogamesim-20130107/www/Changes0000664000000000000000000000173311056522423014375 0ustar rootroot0.33 Added Polish language 0.32 Added Chineze language thanks 陈致杰 0.31 Added Cz language thanks cyscorba 0.30 * Parses the digits with thousands delimited by a period, ex: 123.456 == 123456; 0.29 * Fix increment counter bug; * Added INSTALL file; 0.28 * Added visitors counter; 0.27 * Added optimisaztion request URL's; 0.26 * Fix attack order for new unit; 0.25 * Added new units; 0.25 * Save sim-results between language switchs; 0.24 * Added autoselect interface language (from browser settings); 0.23 * Added flags for supported languages; 0.22 * Fix catalan unit names; 0.21 * Fix errors in Deutch language; 0.20 * Added Deutch language; * Add limit MAX_UNITS; 0.19 * Added PO-mechanizm for translate interface; * Added French language; 0.18 * Added Catalan language; * Fix few html-tags errors; * Add error messages screen. 0.17 * Added Spanish language; * Added Changes file. ogamesim-20130107/www/img/0000775000000000000000000000000010561362040013647 5ustar rootrootogamesim-20130107/www/img/background.jpg0000664000000000000000000007521310263164275016511 0ustar rootrootJFIFddDucky!Adobed#Ez   #%'%#//33//@@@@@@@@@@@@@@@&&0##0+.'''.+550055@@?@@@@@@@@@@@@" !0@P`1A"p2#3B$CD !1AQaq" 20@P`BRbpr#񂒢3CSc$4`!1 0pQAqPa J^ذ ((Yj*H )l&4B ,JQ(%R(e,,!RJ"@R(eUB,LX5 ;zOSxyk=*t89%[&nF|Y%P %ZK[Rk:,e2"\[ HZK!Bʰ ,TIhPR@),` UBjų*.?~gxԗq9bgVNWy9[JZ(h",,@rB[.DD,`h(Eh(!,J"*J̒]fÿ7R:g˞zq,]oC{S顝CWSuJ( ( (b(  " J [eHV,T*IjXHYI`ʡd ,PX5 "-s~>'|.z%c{MtN=0tt "j P(% P*(( %YV ,%,(AHE bX,>;+??|8g<1uׇZIҳC9# *R, , RY@",*QBT Q,((!h!((YlJ Պ5- %*K(K nj %  *Ok\l>kߠO7<3yuhLlBw>MB( (%e+,&J(Kh@e j ԨK* eZ9ޏ=b 7>ObMS2ۏc~7u=\NyγӇH'J](ӞR@P eHP (`(!l  @, *)%E*QZ:sIo~{RU,|4y>#O|ϵ+ɍ穝w4Nznz\dt:j@ ,JHPBJ !@(PB@ ,T*Pu%LlԖ˟Nk;ssS?Gg z3`>OO+÷zbnlMڝ9r;_7-O%%J"XK(@J"QJ% %P%R8%o6$J z=^U,=?W]z>?3|kZ:33ۇCFz`ǣ:RϏBR %BʤPJ `) @(,X_>\Z%oysg~vΚA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5N-ODg ͗%BFX=|yy V_Fϛ?//'gGxyN[=v̭=i-L[lZz"/ODZz"ިEQjŽQoT[-=izEODZz?8~qoTZcz-8ECrG,i!ʌ* drcL,[ִy3ɝoy|~4zTҋL>iT*QU^uQn ulטSijvثd~2mQeឭ;wHXm^| 4L߾@;ogamesim-20130107/www/img/flags/es.gif0000664000000000000000000000203706666371006016060 0ustar rootrootGIF89a-JBJ1RZ!Z!9Z!JZJc!)c{Rc{Zs9sZsc{sB!RB!)1s!)9R)sZ9ZZƭ1)9Z{JƵBs)!RccZccsckB{ƄƌƔƥƭƽ!{ΔΔ{ΜΥέεεεν֜kֵބޔޥޥ!޵R{,-H*\ȰÇ#JHŋȱǏ CtCɓmN\ɲ%K'N\ʜM*6O[f`(?LÌ :P&I,"CYO5.pDlҚYȔ*) /siaCFX@E\lpqbԠXf-j~!2atvf=&HPE,G q z AwK5gHAƍ4HNسgνO1 ;ogamesim-20130107/www/img/flags/es-catal.gif0000664000000000000000000000165506673615416017153 0ustar rootrootGIF89a-!Z,- H*\ȰÇHHŋ3ȱǏ CIdɌ(S˗0ȜI͛8s0ɳϟ@ ݸQ0*]ʔЧPJΫVbݪ+ׯ 8سfӢ]mӷprݻ"߁;ogamesim-20130107/www/img/flags/small_en.gif0000664000000000000000000000136010541735262017234 0ustar rootrootGIF89a58 : ;@ N"O$P(T5]9`5`;aBeAfWy%()6&C4G9J:|~|{UGVIYLZLaTfZi]m`~u{ΆӍԑӔ֗؟٭ڱфՅ՘כ䊄揋!,@YW4 -?>, *: C BVO/ ?'6AUQ(6Y '7AYP0 (".- (ƺ0+;LZOO$"J8!Ä "Lqb !H)RBȓ;A *)9N0BB *S,IC"E8PXvGhYRbÎ ,@TБ~j`4H;ogamesim-20130107/www/img/flags/small_fr.gif0000664000000000000000000000017510541735262017244 0ustar rootrootGIF89a-1\x !mb!,B ДA]7AqGu&*QaZ`^H̆6cI$B&;ogamesim-20130107/www/img/flags/small_pl.gif0000664000000000000000000000011311056522027017233 0ustar rootrootGIF89a! ,ڋ޼H扦ʶa;ogamesim-20130107/www/img/flags/cz-flag.gif0000664000000000000000000000012210702767544016767 0ustar rootrootGIF89a,+̎;a sNZٝYn5`:닶0)ˑU$ƶ%&<Є2#xzFcNO$*|}B"(&%  RMuA;ogamesim-20130107/www/img/flags/de.gif0000664000000000000000000000163406670130305016031 0ustar rootrootGIF89a2!,2H*\ȰÇ#JHŋ3jȱ CIɓ#\ɲ˗0cʜI͛8sɳϟ@ Jѣ,(]ʴӧP6%@իXjʵׯ`ÊKٳhӪ]˶۷a;ogamesim-20130107/www/img/flags/small_de.gif0000664000000000000000000000022510541735262017221 0ustar rootrootGIF89a!!1!,BI8{`((hip,Dmx~|@aH,Ńrl:tJNجvz7;ogamesim-20130107/www/img/flags/small_es-catal.gif0000664000000000000000000000024510541735262020324 0ustar rootrootGIF89a +, F G !,RI){`($hp,`x D(dl:P&`JZSz`XL(tyf3|;ogamesim-20130107/www/img/flags/en.gif0000664000000000000000000000261506666371026016057 0ustar rootrootGIF89a<9999BBB!JZ{ckkkss{{΄΄))1!1)J9JBRBRJZJZRcRcZkZkcscsk{k{ssƽ,<CA(\Ȑa*HE†H`a^HX3.|#D?d89 b"%OˊC1֜#EN%G1ЂBU}YJ .@H* $ Ea@BjmlCNf'7eF`[-\ė ]|7<"K$e b`D'7 #v]zr-Yʢ2~CuϏ+;.9 Ь>_7˸%" 6rUVȠfv ($hYb\@5@ND:d?ߑtPZ#pCtGWUrZe%iyA\Y_$v ɖٙYp <'4A%D&pEuUi9Xgs–ft%2PSiP tFY/Y LՔiI5l*СJ Jd$@ZFMj5(DF{{z5mٲ -Jdkc pD)@,X+RB@;ogamesim-20130107/www/img/flags/ru.gif0000664000000000000000000000162706751141374016101 0ustar rootrootGIF87a<,<sH*\ȰÇ @HĊ'ظ1dž?ȓ(S.42%˖Mv3L9^ScI<{ )"KEԙR/D*hիXjʵׯ`Ê+0 ;O8)ogamesim-20130107/www/img/flags/cn-flag.gif0000664000000000000000000000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W%W.{w,fj,0mk8 k%WTOP}h?+8ty0~R5#IFd|.xav,cpf9H@oO8O"nBoB@o df`-U8qX xl52lRwp78)4mv!CPT yFpl"H8H pTr:Ph`tNc5s+- Ky51ipmoQgIF lGApkHPo0ox>@~{ V("Qqp0WB@lB 6 gBPkApWs4,QviP=#UxVH;U2`I9owe1$bo>TjTHr9.V.XH{A1/r+O)Zɕ`Y`o2@C-Iy8TIrh_%mR{B Cakq֨Әo}F&rpRpaP'4 N4/Q։F%PKPK~"SrHI$LW9 q NqEw!  CńН i9`!YpXBI$ 0T0N!P j'G{  YU  ? ' eL`%2R#qUW͙M@4p0S U0 @.k0DWɗ0pwB}%AAdxPJ0t:Xv:X$g9c{PJ'$ :[R`9=!4bIVSEk:F,]b:0$8yj N0zc!^`J@q1Ʀd49Jv ()PJ9]Jv3Z`A 0%Ә11&_Yꋷȋ)@eCYP6z9]@D vj≮a8cmXcCWw^]iVEP*0+s /Z@/  & +k|5;9:V /;K*@:9)S gUKЦ nTie@ ZZMIp86il{ {Bz`zP'5;v`ahOPT K0@\@a0*3O6r@˹ϻVVY@sB  @F p|v%^W + 9s3++ppFSi KVz{p7V+K/; x'ؼ[„V`wb1/`'Ҿp!SR@0+"qؿ;\,4<\0RP rRwejl|POL\K FWuKl;kл*pzPf)OE",Rz͒ɇ|EPWw % ڣb(S@q*"c?@#A!RV}X** ctߒ, m=+!!R#W! rڑ*vr"o4-%%!S}!B\A*_$bpW_zc ȡ^mڤ=wH\p bg=>ᤷqܑU'x!jۉy̍)#a(K4q%R-?)Z) s!" 2q!E*t&~& 6@ B1 ^*JqpNN@:BP zE\ X嵀! &`bhj 2!`! p xznH {Hd` ְ@>\>^~阞难k;ogamesim-20130107/www/img/delete.gif0000664000000000000000000000011610475230520015577 0ustar rootrootGIF89a 3\!, 6rr.z?9%}bj.G;ogamesim-20130107/www/img/counter/0000775000000000000000000000000010561374371015340 5ustar rootrootogamesim-20130107/www/img/counter/2.png0000664000000000000000000000055510561371730016210 0ustar rootrootPNG  IHDR n5gAMA7tEXtSoftwareAdobe ImageReadyqe<cPLTEyyyMjYd{Q^wcis`kprwYdx[bqx}TazAV4Efm!tRNS!cIDATxl EP0W:".yn ;W Q!J+FcuDfLWD| >/ s9xIENDB`ogamesim-20130107/www/img/counter/6.png0000664000000000000000000000062210561371735016214 0ustar rootrootPNG  IHDR n5gAMA7tEXtSoftwareAdobe ImageReadyqe<{PLTE{}eo`kuvx=Lh}~t}HUnMjeoERken~V_o8Hghlt|louXatrxCQlTaz{}GToLZuJXsR]r;KjMZrt}HUnnwyyyAV4Efi'tRNSVqIDATxl0 д4p"s&෼˒=]qPJU"2Sgf-rĹpH w5逧(- ζ> ly5IENDB`ogamesim-20130107/www/img/counter/9.png0000664000000000000000000000063110561371744016217 0ustar rootrootPNG  IHDR n5gAMA7tEXtSoftwareAdobe ImageReadyqe<xPLTETazHUnV_oMj8Hg`k|Yd{MYpERkv}cismvMZrTazeot}LZuJXs[bqaiwDSp~yyyAV4Ef&tRNSzoIDATxT0 P'@)t@IpFFC$|}KBIAq\ '"Աhs fA|].kZߟ^mؽ0 0 @UIENDB`ogamesim-20130107/www/img/counter/7.png0000664000000000000000000000051110561371742016210 0ustar rootrootPNG  IHDR n5gAMA7tEXtSoftwareAdobe ImageReadyqe<TPLTEyyyYdx{}gqv}:JiR\nLZuhlt\euJUleoHUn~Q^wuvx8HgAV4Ef'tRNSSIDATxbDiI) ~0Y\\ aeb㈊0ebq8 #s`PZdIENDB`ogamesim-20130107/www/img/save.gif0000664000000000000000000000012710475231650015302 0ustar rootrootGIF89aGdl!,( zM xK Z%ۉ.**fqmމ=~;ogamesim-20130107/www/img/load.gif0000664000000000000000000000021310475231040015250 0ustar rootrootGIF89a 3f I\ UGd!, 89j{Y`b'G+W[0@ _XBHt&o$P9ۭ(;ogamesim-20130107/www/index.cgi0000775000000000000000000005273011056522520014701 0ustar rootroot#!/usr/bin/perl # Copyright (C) by Dmitry E. Oboukhov 2006, 2007 # # This package is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This package is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this package; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA use strict; use warnings; our $VERSION=0.33; eval { # use encoding 'utf8'; # binmode(STDOUT=>'encoding(utf8)'); require HTML::Template; require CGI::Simple; require POSIX; require IPC::Open2; require Sys::CPU; # количество процессов для симуляции my $forks_count=eval { Sys::CPU::cpu_count(); }; $forks_count or $forks_count=1; # максимальное время счета симулятором # 0 = no limits my $max_simulation_time=15; # имя скрипта my $script_name; # урл скрипта my $script_url; # доступные языки (и кодировки к ним) my %langs= ( ru => [ 'utf-8', 'Russian', 'small_ru.gif' ], en => [ 'utf-8', 'English', 'small_en.gif' ], sp => [ 'utf-8', 'Spanish', 'small_es.gif' ], ca => [ 'utf-8', 'Catalan', 'small_es-catal.gif' ], fr => [ 'utf-8', 'French', 'small_fr.gif' ], de => [ 'utf-8', 'Deutsch', 'small_de.gif' ], cz => [ 'utf-8', 'Czech', 'cz-flag.gif' ], cn => [ 'utf-8', 'Chinese', 'cn-flag.gif' ], pl => [ 'utf-8', 'Polish', 'small_pl.gif' ], ); # дефолтный путь к фаблону html my $template_name='template/sim.en.html'; # конфиг юнитов my $units_conf='csim/units.conf'; # дефолтный язык my $lang='en'; # заголовок my $title=sprintf "GPL Ogame Simulator GUI v%1.2f", $VERSION; # путь к симулятору my $simulator='./csim/csim'; # включить отладку my $debug=0; # количество симуляций по умолчанию my $simulations=100; # максимальное количество симуляций my $max_simulations=200; # данные из CGI и данные по всем юнитам и названия ресурсов # в шпионских докладах my (%cgi, @units, %info); # счетчик посещений my $counter_file='spool/counter.txt'; # лимит на количество юнитов my $units_limit=1000000; # возвращает номер версии csim sub get_version_csim() { open my $csim, "-|", $simulator, "-V"; my $version=<$csim>; chomp($version); close $csim; $? or return $version; return; } # делает из длинного целого числа число с разделенными точками # то есть например из 123456789 сделает 123.456.789 sub longint_to_str($) { my ($num)=@_; $num or return $num; my @letters=unpack('c*', "$num"); $_=pack('c', $_) for @letters; my @result; my $i=0; for (my $i=1; @letters; $i++) { unshift @result, pop @letters; $i<3 and next; $i=0; unshift @result, '.'; } $result[0] eq '.' and shift @result; return join("", @result); } # читает конфиг, возвращает массив юнитов sub get_hash_info() { -e $units_conf or die "Can not find $units_conf: $!"; open my $conf, "<", $units_conf; my @lines=<$conf>; close $conf; s/^\s+//, s/#.*$//, s/\s+$// for @lines; # выбираем по очереди юнит за юнитом for (my $uno=1; my @unit=grep /^unit$uno\./i, @lines; $uno++) { my %unifo; ($unifo{name_default})=grep /^unit$uno\.name[\s=]/i, @unit; $unifo{name_default}=~s/^unit$uno\.name\s*=\s*//i; defined $unifo{name_default} or die "option 'unit$uno.name' not defined!"; for my $lang (keys %langs) { $unifo{"name_$lang"}=$unifo{name_default}; my ($name)=grep /^unit$uno\.name\.$lang(?:[\s=])/i, @unit; $name=~s/^unit$uno\.name\.$lang\s*=\s*//i; defined $name or die "option 'unit$uno.name.$lang' not defined!"; $unifo{"name_$lang"}=$name; } my ($order)=grep /^unit$uno\.order[\s=]/i, @unit; defined $order and $order=~s/^unit$uno\.order\s*=\s*//i; defined $order or die "Can not find unit$uno.order"; $unifo{order}=$order; my ($ground)=grep /^unit$uno\.ground[\s=]/i, @unit; defined $ground and $ground=~s/^unit$uno\.ground\s*=\s*//; defined $ground or $ground=0; $unifo{ground}=$ground; my ($capacity)=grep /^unit$uno\.capacity[\s=]/i, @unit; defined $capacity and $capacity=~s/^unit$uno\.capacity\s*=\s*//i; defined $capacity or $capacity=0; $unifo{capacity}=$capacity; push @units, \%unifo; } @units = sort { $a->{order} <=> $b->{order} } @units; # информация о названиях ресурсов и технологий # в шпионских докладах (для парсинга) # всякие переводы for my $par (qw(metal crystal deut attack shield armory attacker defender debris), 'debris.loss', 'debris.max_loss', 'debris.min_loss', 'debris.min', 'debris.max', ) { for (grep(/^$par\./i, @lines)) { /^([\w\-_\.]+) ?= ?(.*)/ and $info{$1}=$2; } for (keys %langs) { exists $info{"$par.$_"} or die "Option '$par.$_' not defined!"; } } } # запускает симуляцию (в форке) sub start_sim($) { my ($task)=@_; my ($reader, $writer); my $pid=IPC::Open2::open2($reader, $writer, $simulator, "-s", $simulations, "-t", $max_simulation_time, "-f", $forks_count, ) or die "Can not start '$simulator': $!"; print $writer $task; close $writer; my @lines=<$reader>; waitpid $pid, 0; # $? or return @lines; } # парсит результаты симуляции sub parse_result(@) { my (@lines)=@_; my ($section, %sections)=('begin',); for (@lines) { s/^\s+//; s/\s+$//; s/\s+/ /g; /^\s*$/ and next; /\[(.*)\]/ and $section=$1, next; exists $sections{$section} or $sections{$section}=[]; push @{$sections{$section}}, $_; } # проверяем все ли секции на месте for ('begin', 'Simulate task', 'Simulate info', 'Best attacker', 'Worst attacker', 'Best defender', 'Worst defender', 'Average debris', 'Minimum debris', 'Maximum debris', 'Average simulation', 'Average capacity after combat', 'Attacker plunder') { # ошибочный файл exists $sections{$_} or return ( result => join("\n", @lines), ); } # парсим все выводы результатов боя for my $cmb ('Simulate task', 'Best attacker', 'Worst attacker', 'Best defender', 'Worst defender', 'Average simulation') { my %result; my $what='attacker'; for (@{$sections{$cmb}}) { $what='attacker', next if /^Attacker/i; $what='defender', next if /^Defender/i; /^(.*?)\s*:\s*(\d+.*)/ or next; $result{$what}{$1}=$2; } $sections{$cmb}=\%result; } # добытые ресурсы my ($metal, $crystal, $deut, $nsmall, $nlarge)=(0, 0, 0, 0, 0); for (@{$sections{"Attacker plunder"}}) { /^Metal\s*:\s*(\d+)/i and $metal=longint_to_str $1; /^Crystal\s*:\s*(\d+)/i and $crystal=longint_to_str $1; /^Deut\s*:\s*(\d+)/i and $deut=longint_to_str $1; /^Needed Small chargo: (\d+)/i and $nsmall=$1; /^Needed Large chargo: (\d+)/i and $nlarge=$1; } $sections{resource}=[ $metal, $crystal, $deut, $nsmall, $nlarge]; for my $debris ('Minimum debris', 'Maximum debris', 'Average debris') { my %result; for (@{$sections{$debris}}) { /^Attacker loss: metal=(\d+) crystal=(\d+) deuterium=(\d+)/i and $result{attacker}=[$1, $2, $3]; /^Defender loss: metal=(\d+) crystal=(\d+) deuterium=(\d+)/i and $result{defender}=[$1, $2, $3]; /^Common loss: metal=(\d+) crystal=(\d+) deuterium=(\d+)/i and $result{both}=[$1, $2, $3]; /^Debris with ground: metal=(\d+) crystal=(\d+)/i and $result{debris_with_ground}=[$1, $2, $1+$2]; /^Debris without ground: metal=(\d+) crystal=(\d+)/i and $result{debris}=[int $1, int $2, $1+$2]; /^Recyclers with ground: (\d+)/i and $result{recyclers_with_ground}=$1; /^Recyclers without ground: (\d+)/i and $result{recyclers}=$1; /^Chance moon without ground: (\d+%)/i and $result{moon}=$1; /^Chance moon with ground: (\d+%)/i and $result{moon_with_ground}=$1; } for my $ary ($result{attacker}, $result{defender}, $result{both}, $result{debris_with_ground}, $result{debris}) { $ary->[0]=longint_to_str $ary->[0]; $ary->[1]=longint_to_str $ary->[1]; $ary->[2]=longint_to_str $ary->[2]; } $sections{$debris}=\%result; } # количество раундов my ($rounds)=grep /^Rounds:/, @{$sections{"Simulate info"}}; $sections{rounds}=['', '', '']; $rounds and $rounds=~/^Rounds: (\d+\.\d+) \((\d), (\d)\)/ and $sections{rounds}=[$1, $2, $3]; for my $who ('attacker', 'defender') { $sections{$who."_win"}=['', '']; my ($win)=grep /^$who win: \d+\/\d+/i, @{$sections{"Simulate info"}}; $win and $win=~/^$who win: (\d+)\/(\d+)/i and $sections{$who."_win"}=[$1, $2]; } return ( result => join("\n", @lines), %sections, ); } # делает симуляцию sub simulate() { $cgi{'no_count'} and return (); my @task=("\ndefender\n",); # составляем задание для симулятора for (my $uno=0; $uno < scalar @units; $uno++) { my $name=$units[$uno]->{name_default}; $cgi{"a$uno"} and unshift @task, "$name=" . $cgi{"a$uno"}; $cgi{"d$uno"} and push @task, "$name=" . $cgi{"d$uno"}; } # если в задании нет атакера или дефендера - не считаем ничего $task[0] =~ /defender/si and $task[-1] =~ /defender/si and return (); # параметры атакера и дефендера push @task, ''; unshift @task, ''; for (qw(attack shield armory)) { exists $cgi{"a$_"} and unshift @task, "$_=" . $cgi{"a$_"}; exists $cgi{"d$_"} and push @task, "$_=" . $cgi{"d$_"}; } unshift @task, "attacker\n"; # ресурсы у дефендера $cgi{dmetal} and push @task, "\nmetal=$cgi{dmetal}"; $cgi{dcrystal} and push @task, "crystal=$cgi{dcrystal}"; $cgi{ddeut} and push @task, "deut=$cgi{ddeut}"; my $task=join("\n", @task); my %sim=parse_result(start_sim $task); return ( task => $task, %sim ); } # определяем путь к скрипту (URL) if (exists $ENV{SCRIPT_NAME}) { # имя скрипта $script_name=$ENV{SCRIPT_NAME}; # урл скрипта exists $ENV{HTTP_HOST} and $script_url="http://$ENV{HTTP_HOST}$ENV{SCRIPT_NAME}"; } else { $script_name="$0"; $script_name=~s/.*[\/\\]//; $script_url=$script_name; } %cgi=CGI::Simple->new()->Vars; { my $reload=0; my $request=''; for (keys %cgi) { defined $cgi{$_} or $reload=1, next; length $cgi{$_} or $reload=1, next; length $request and $request .= '&'; $request .= "$_=$cgi{$_}"; } if ($reload) { print "location: $script_url?$request\n\n"; exit 0; } } get_hash_info(); # определяем язык на котором выдавать интерфейс if (defined $cgi{lang}) { my $form_lang=$cgi{lang}; exists $langs{$form_lang} and $lang=$form_lang; } elsif (defined $ENV{HTTP_ACCEPT_LANGUAGE}) { my $accept_langs=$ENV{HTTP_ACCEPT_LANGUAGE}; $accept_langs=~s/;.*$//; $accept_langs=~s/\s+//g; for (split /,/, $accept_langs) { if (exists $langs{$_}) { $lang=$_; last; } } } { my $tname=$template_name; $tname=~s/\.\w\w\.htm(l)?$/.$lang.htm$1/; -e $tname and $template_name=$tname; } my $template=HTML::Template->new(filename => $template_name); # все параметры или целые числа # или undef (кроме lang) for (keys %cgi) { s/\s+//g; $_ eq 'lang' and next; $_ eq 'report' and next; defined $cgi{$_} or next; length $cgi{$_} or next; $cgi{$_} = abs int $cgi{$_}; $units_limit and /^[ad]\d+/ and $cgi{$_}>$units_limit and $cgi{$_}=$units_limit; } $template->param(script_name => $script_name); $cgi{simulations} and $cgi{simulations}<=$max_simulations and $simulations=$cgi{simulations}; $template->param(simulations => $simulations); # получить репорт if ($cgi{get_report}) { $template->param(get_report => 1); # язык $template->param(lang => $lang); if ($cgi{report}) { my $report=$cgi{report}; $report=~s/\s+/ /sg; $report=~s/\.//g; my @defender; # юниты for (my $uno=0; $uno{name_default}; push @names, $unit->{"name_$_"} for keys %langs; for my $name (@names) { if ($report=~/$name\s*:?\s*(\d+)/i) { $defender[-1]->[1]=$1; last; } } } for (@defender) { my %res; $res{item}=$$_[0]; $res{value}=$$_[1]; $_=\%res; } # технологии и ресурсы for my $item (qw(metal crystal deut attack shield armory)) { # собираем всевозможные имена для ресурса/технологии my @names; push @names, $info{"$item.$_"} for keys %langs; my %res=(item=>"d$item", value=>''); for my $name (@names) { if ($report=~/$name\s*:?\s*(\d+)/i) { $res{value}=$1; last; } } push @defender, \%res; } $template->param(FromRep => \@defender); $template->param(report_parsed => 1); } } # вывести основной репорт else { my %sim; %sim=simulate() unless ($cgi{no_count}); # массив флотов и защитных сооруужений my (@fleet, @ground); my $uno=0; # выводим флот и защиту for (my $uno=0; $uno < scalar @units; $uno++) { my $unit=$units[$uno]; my ($acount, $dcount)=('', ''); $cgi{"a$uno"} and $acount=$cgi{"a$uno"}; $cgi{"d$uno"} and $dcount=$cgi{"d$uno"}; my $array=\@fleet; $unit->{ground} and $array=\@ground; my ($average_attacker, $average_defender, $best_attacker, $worst_attacker, $best_defender, $worst_defender)=(0, 0, 0, 0, 0, 0); $acount or $best_attacker=$worst_attacker=$average_attacker='-'; $dcount or $best_defender=$worst_defender=$average_defender='-'; $unit->{ground} and $best_attacker=$worst_attacker=$average_attacker=''; for my $item ( [\$average_attacker => attacker => 'Average simulation'], [\$average_defender => defender => 'Average simulation'], [\$best_attacker => attacker => 'Best attacker'], [\$best_defender => defender => 'Best defender'], [\$worst_attacker => attacker => 'Worst attacker'], [\$worst_defender => defender => 'Worst defender']) { my ($link_value, $who, $section)=@{$item}; exists $sim{$section}->{$who}{$unit->{name_default}} and $$link_value=$sim{$section}->{$who}{$unit->{name_default}}; } push @{$array}, { unit => $unit->{"name_$lang"}, present_attacker => ($unit->{ground} or $uno==10)?0:1, no => $uno, acount => $acount, dcount => $dcount, average_attacker => $average_attacker, average_defender => $average_defender, best_attacker => $best_attacker, worst_attacker => $worst_attacker, best_defender => $best_defender, worst_defender => $worst_defender, }; } $template->param(Fleet => \@fleet); $template->param(Ground => \@ground); for (qw(aattack dattack ashield dshield aarmory darmory dmetal dcrystal ddeut)) { exists $cgi{$_} and $template->param($_ => $cgi{$_}); } if ($sim{task}) { $template->param(show_statistic => 1); my @losses; # выводим потери/обломки for ( ["debris.loss" => 'Average debris'], ["debris.min_loss" => 'Minimum debris'], ["debris.max_loss" => 'Maximum debris'], ) { my ($name, $section)=($info{"$$_[0].$lang"}, $$_[1]); my %lss=( loss_name => $name, attacker_loss_metal => $sim{$section}->{attacker}->[0], attacker_loss_crystal => $sim{$section}->{attacker}->[1], attacker_loss_deut => $sim{$section}->{attacker}->[2], defender_loss_metal => $sim{$section}->{defender}->[0], defender_loss_crystal => $sim{$section}->{defender}->[1], defender_loss_deut => $sim{$section}->{defender}->[2], ); push @losses, \%lss; } $template->param(Losses => \@losses); # обломки my @debris; for ( ["debris" => 'Average debris'], ["debris.min" => 'Minimum debris'], ["debris.max" => 'Maximum debris'], ) { my ($name, $section)=($info{"$$_[0].$lang"}, $$_[1]); my %dbr=( dbr_name => $name, debris_metal => $sim{$section}->{debris}->[0], debris_crystal => $sim{$section}->{debris}->[1], with_ground_debris_metal => $sim{$section}->{debris_with_ground}->[0], with_ground_debris_crystal => $sim{$section}->{debris_with_ground}->[1], debris_total => $sim{$section}->{debris}->[2], with_ground_debris_total => $sim{$section}->{debris_with_ground}->[2], ); push @debris, \%dbr; } $template->param(Debris => \@debris); # переработчики for ( [ 'Average debris' => 'recyclers' => 'wg_recyclers' ], [ 'Minimum debris' => 'min_recyclers' => 'wg_min_recyclers' ], [ 'Maximum debris' => 'max_recyclers' => 'wg_max_recyclers' ], ) { my ($section, $var, $wgvar)=@{$_}; $template->param($var => $sim{$section}->{recyclers}); $template->param($wgvar => $sim{$section}->{recyclers_with_ground}); } # шанс луны $sim{'Average debris'}{moon} and $template->param(without_ground_chance_moon => $sim{'Average debris'}{moon}); $sim{'Average debris'}{moon_with_ground} and $template->param(with_ground_chance_moon => $sim{'Average debris'}{moon_with_ground}); $template->param(rounds => $sim{rounds}->[0]); $template->param(min_rounds => $sim{rounds}->[1]); $template->param(max_rounds => $sim{rounds}->[2]); # ресурсы $template->param(ametal => $sim{resource}->[0]); $template->param(acrystal => $sim{resource}->[1]); $template->param(adeut => $sim{resource}->[2]); $template->param(small_chargos => $sim{resource}->[3]); $template->param(large_chargos => $sim{resource}->[4]); # количество побед $template->param(attacker_win => $sim{attacker_win}->[0]); $template->param(defender_win => $sim{defender_win}->[0]); $template->param(asimulations => $sim{attacker_win}->[1]); $template->param(dsimulations => $sim{defender_win}->[1]); } # язык $template->param(lang => $lang); # имена технологий $template->param(attack_name => $info{"attack.$lang"}); $template->param(shield_name => $info{"shield.$lang"}); $template->param(armory_name => $info{"armory.$lang"}); # путь к урлу скрипта $template->param(script_url => $script_url); # языковые ссылки my (@lang_urls); for (sort keys %langs) { my %linfo= ( langurl => "$script_url?lang=$_", langname => $langs{$_}->[1], langid => $_, langflag => $langs{$_}->[2], ); for my $par(keys %cgi) { defined $cgi{$par} or next; length $cgi{$par} or next; $par eq 'lang' and next; $linfo{langurl}.="&$par=$cgi{$par}"; } push @lang_urls, \%linfo; } $template->param(Langs => \@lang_urls); # счетчик if (defined $counter_file and length $counter_file) { require CGI::Counter; my $counter=CGI::Counter->new($counter_file); $counter->inc; $template->param(counter => $counter->value); } # отладочная информация $debug and $template->param(debug => $sim{result}); } $title .= " (csim v" . get_version_csim() . ")"; $template->param(cpu => $forks_count); $template->param(title => $title); my $output=$template->output; $debug or $output=~s/\s+/ /sg; print "Content-Type: text/html; charset=$langs{$lang}->[0]\n\n$output"; }; $@ and print qq(Content-Type: text/html; charset=UTF-8\n\n Critical Error $@ ); ogamesim-20130107/www/mlhtml/0000775000000000000000000000000010540205244014367 5ustar rootrootogamesim-20130107/www/mlhtml/htmlputtext.pl0000664000000000000000000000777710540205244017350 0ustar rootroot#!/usr/bin/perl use warnings; use strict; use Getopt::Long; use POSIX; use Encode; our $VERSION=1.0; our $tagname='gt'; our ( $htmlcharset, # html charset $html, # input file name $output, # output file name $po, # po-file )=('UTF-8'); sub usage() { print <) { s/^\s+//; s/\s+$//; if ($_ eq '') { length $rec and push @records, $rec; $rec=''; } $rec .= "$_\n"; } length $rec and push @records, $rec; for (my $i=$#records; $i>=0; $i--) { defined $records[$i] and $records[$i]=~/\S/s and next; splice @records, $i, 1; } my $lineno=1; for $rec (@records) { my $flags=''; my ($msgid, $msg); my @lines=split /\n/, $rec; s/\s+$// for @lines; for (@lines) { /^#,\s*(.*)/ and $flags .= " $1"; /^#/ and $lineno++, next; /^$/ and $lineno++, next; if (/^msgid\s+"(.*)"/) { defined $msgid and die "msgid already defined: $msgid ($_)\nline: $lineno\n"; $msgid=$1; $lineno++; next; } defined $msgid or die "msgid not defined: $_\nline: $lineno\n"; if (/^msgstr\s+"(.*)"/) { defined $msg and die "msgstr already defined: $msg ($_)\nline: $lineno\n"; $msg=$1; $lineno++; next; } defined $msg or die "msgstr not defined: $_\nline: $lineno"; /^"(.*)"$/ or die "Unknown format line: $_\nline: $lineno\n"; $msg .= "\n$1"; $lineno++; } defined $msgid and $msgid=~s/\\"/"/g, $msgid=~s/\\\\/\\/g; defined $msg and $msg=~s/\\n/\n/g, $msg=~s/\\r/\r/g, $msg=~s/\\t/\t/g, $msg=~s/\\a/\a/g, $msg=~s/\\(\S)/$1/g; $rec={flags=>$flags, msgid=>$msgid, msgstr=>$msg}; # print STDERR $rec->{msgid}, "\n"; } for (my $i=$#records; $i>=0; $i--) { unless (defined $records[$i]->{msgid} and defined $records[$i]->{msgstr}) { splice @records, $i, 1; } } return @records; } GetOptions ( 'p=s' => \$po, 'o=s' => \$output, 'tag=s' => \$tagname, 'charset=s' => \$htmlcharset, ) or usage; $html=$ARGV[0] or usage; -r $html or die "Can not find file '$html'"; my $data; { open my $file, '<', $html or die "Can not open file '$html': $!"; local $/; $data=<$file>; } if (defined $output) { open my $file, '>', $output or die "Can not open file '$output': $!"; POSIX::dup2(fileno($file), fileno(STDOUT)); } my @blocks=split /<\s*$tagname\s*>.*?<\s*\/$tagname\s*>/is, $data; my @tags=$data=~/<\s*$tagname\s*>\s*(.*?)\s*<\s*\/$tagname\s*>/isg; s/\s+/ /sg, s/^\s//, s/\s$// for @tags; my @poary=readpo; print STDERR "Found ", scalar(@poary), " message blocks\n"; my $charset='UTF-8'; for (@poary) { $_->{msgid} eq '' or next; $_->{flags} =~ /fuzzy/ and next; $_->{msgstr} =~ /Content-Type:\s*\w+\/\w+\s*;\s*charset=\s*(\S+)/si or next; $charset=$1; } while(@blocks) { print shift @blocks; my $tag=shift @tags; defined $tag or next; my $tagnew; for my $potag (@poary) { $potag->{flags}=~/fuzze/ and next; if ($potag->{msgid} eq $tag) { length $potag->{msgstr} or next; $tagnew=$potag->{msgstr}; $tagnew=Encode::decode($charset, $tagnew, Encode::FB_CROAK); $tagnew=Encode::encode($htmlcharset, $tagnew, Encode::FB_CROAK); } } unless (defined $tagnew) { $tagnew=$tag; print STDERR "Found '$tag' ... FAILED\n"; } print $tagnew; } ogamesim-20130107/www/mlhtml/htmlgettext.pl0000664000000000000000000000643610540107523017307 0ustar rootroot#!/usr/bin/perl use warnings; use strict; use Getopt::Long; use POSIX; our $VERSION=1.0; our $tagname='gt'; # gettext mark tagname our ( $pot, # Name for output POT $html, # Name for input html-file $printversion, # Print version only $setversion, # version package $package, # package name $copyright, # copyright string $email, # upstream author email $charset, # charset $langteam, # $desc, # ); # show Usage sub usage() { print < Selected text ); -sv version - set package version (for POT-headers); -package name - set package name (for POT-headers); -copyright string - set copyright string (for POT-headers); -email mail\@domain - set upstream author email (for POT-headers); -charset name - set charset (for POT-headers); -langteam team - set language team (for POT-headers); -desc string - descreptive string (for POT-headers); endusage exit -1; } GetOptions ( "o=s" => \$pot, v => \$printversion, "tag=s" => \$tagname, "sv=s" => \$setversion, "package=s" => \$package, "copyright=s" => \$copyright, "email=s" => \$email, "charset=s" => \$charset, "langteam=s" => \$langteam, "desc=s" => \$desc, ) or usage; if ($printversion) { print $VERSION, "\n"; exit 0; } $html=$ARGV[0]; defined $html or usage; -r $html or die "Can not found file '$html'"; my $data=''; { open my $file, '<', $html or die "Can not open file '$html': $!"; local $/; $data=<$file>; } if (defined $pot) { open my $file_out, ">", $pot or die "Can not open file '$pot': $!"; POSIX::dup2(fileno($file_out), fileno(STDOUT)); } my @blocks=split /<\s*$tagname\s*>.*?<\s*\/$tagname\s*>/is, $data; my @tags=$data=~/<\s*$tagname\s*>\s*(.*?)\s*<\s*\/$tagname\s*>/isg; s/\s+/ /sg, s/^\s//, s/\s$//, s/\\/\\\\/gs, s/"/\\"/gs for @tags; my @ct=localtime; my $current_time=sprintf('%4d-%02d-%02d %02d:%02d', $ct[5]+1900, $ct[4]+1, @ct[3, 2, 1]); defined $setversion or $setversion='PACKAGE VERSION'; defined $package or $package='PACKAGE'; defined $copyright or $copyright="Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER"; defined $email or $email='FIRST AUTHOR , YEAR.'; defined $charset or $charset='CHARSET'; defined $langteam or $langteam='LANGUAGE '; defined $desc or $desc='SOME DESCRIPTIVE TITLE.'; print <\\n" "Language-Team: $langteam\\n" "MIME-Version: 1.0\\n" "Content-Type: text/plain; charset=$charset\\n" "Content-Transfer-Encoding: 8bit\\n" pot my %write_hash; for (@tags) { exists $write_hash{$_} and next; $write_hash{$_}=1; print qq(#\nmsgid "$_"\nmsgstr ""\n\n); } ogamesim-20130107/www/.htaccess0000664000000000000000000000010210530373345014670 0ustar rootrootDirectoryIndex index.cgi Options +ExecCGI AddDefaultCharset utf-8 ogamesim-20130107/INSTALL0000664000000000000000000000501210562665236013314 0ustar rootrootDependences For the properly functionality of the web-interface the next program or modules requred: * CGI supported webserver (for example apache) * Perl interpretator * Perl modules 1. [HTML::Template]; 2. [CGI::Simple]; 3. [IPC::Open2]; 4. [Sys::CPU]; 5. [POSIX] Installation 1. Unpack the archine. 2. Complile the console simulator program. 1. Go to subdir csim 2. If you are using Linux or Unix then execute command make for_linux (gcc and GNU make requred). If you're using Windows then execute command make for_windows (mingw32 and GNU make requred). Note: There are already compiled binary executable files for the Windows and the Linux in the archive. If you're installing the sim on any web hosting you can use those files and skip step 2. 3. Create the directory where the site will locate and configure your webserver for executing the CGI-scripts in this directory. 4. Copy the index.cgi, and as well as subdirectories css, img, template and CGI with their content to the site directory. Copy csim/units.conf to the site directory. And you can copy binary executable file (the calculation module). But in common case this file can be placed in any dirictory. 5. Edit file index.cgi to set configuration parameters. The main parameters are: 1. path to the file units.conf (my $units_conf='csim/units.conf';); 2. path to the simulator (my $simulator='./csim/csim';); 3. read the comments to the other parameters and change it if neccessary. 6. Try to open the the page with the web brouser and fix some problems if they appears (for example there is no access to some file due the permitions). And you should make sure that CGI-script can start the simulator (there are must shown the CGI-script version number and csim version number in the window header). Localization For the sim localization you need: 1. copy csim/langs/TEMPLATE_FOR_NEW_LANGS file to LANG file. 2. replace english terms in it by terms from your local game interface (menu Technology) For the interface localisation you need: 1. copy template/lang/NEW_LANGUAGE_TEMPLATE.pot file to LANG.po file; 2. translate all english strings in it (fill msgstr fields); 3. put in the file header translators info. send me your localization (your LANG.po and LANG files) to intergrate it in the basic version. ogamesim-20130107/COPYING0000664000000000000000000004310310533560223013305 0ustar rootroot GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. ogamesim-20130107/COPYRIGHT0000664000000000000000000000135610711671564013562 0ustar rootrootCopyright (C) by Dmitry E. Oboukhov 2006, 2007 This package is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this package; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ogamesim-20130107/csim/0000775000000000000000000000000012072357373013216 5ustar rootrootogamesim-20130107/csim/sim.c0000664000000000000000000006006012072357373014154 0ustar rootroot/* Copyright (C) by Dmitry E. Oboukhov 2006, 2007 This package is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this package; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include #include #include #include #include "sim.h" #include "unit.h" #include "random.h" #ifndef __WIN32__ #include #include #endif //=================================================================== // симулирует один раунд //=================================================================== static void simulate_attack(int acount, unit * attacker, int dcount, unit * defender) { int i, dkilled, next; // выбираем по очереди атакующую единицу // если вдруг все убиты то прекращаем симуляцию for (i=dkilled=0; iwho_win=NO_WIN; // ничья if (sim->attacker.count && sim->defender.count) return; // ничья со смертью обоих if (sim->attacker.count==0 && sim->defender.count==0) return; if (sim->attacker.count) sim->who_win=ATTACKER_WIN; else sim->who_win=DEFENDER_WIN; } //=================================================================== // вычисляет потери // атакующего и защитника //=================================================================== static void set_debris(sim_result *after_attack, const sim_info *before_attack) { int i, delta_units; debris_resources *attacker, *defender; long long ametal, acrystal, adeut, dmetal, dcrystal, ddeut; memset(&after_attack->debris, 0, sizeof(debris)); for (i=0; idebris.attacker.ground; defender=&after_attack->debris.defender.ground; } else { attacker=&after_attack->debris.attacker.fleet; defender=&after_attack->debris.defender.fleet; } delta_units= before_attack->attacker.unit[i]-after_attack->attacker.unit[i]; ametal=((long long)units[i].metal)*delta_units; acrystal=((long long)units[i].crystal)*delta_units; adeut=((long long)units[i].deut)*delta_units; delta_units= before_attack->defender.unit[i]-after_attack->defender.unit[i]; dmetal=((long long)units[i].metal)*delta_units; dcrystal=((long long)units[i].crystal)*delta_units; ddeut=((long long)units[i].deut)*delta_units; // потери атакующего attacker->metal+=ametal; attacker->crystal+=acrystal; attacker->deut+=adeut; attacker->structure+=ametal+acrystal; attacker->total+=ametal+acrystal+adeut; after_attack->debris.attacker.all.metal+=ametal; after_attack->debris.attacker.all.crystal+=acrystal; after_attack->debris.attacker.all.deut+=adeut; after_attack->debris.attacker.all.structure+=ametal+acrystal; after_attack->debris.attacker.all.total+=ametal+acrystal+adeut; // потери защитника defender->metal+=dmetal; defender->crystal+=dcrystal; defender->deut+=ddeut; defender->structure+=dmetal+dcrystal; defender->total+=dmetal+dcrystal+ddeut; after_attack->debris.defender.all.metal+=dmetal; after_attack->debris.defender.all.crystal+=dcrystal; after_attack->debris.defender.all.deut+=ddeut; after_attack->debris.defender.all.structure+=dmetal+dcrystal; after_attack->debris.defender.all.total+=dmetal+dcrystal+ddeut; } // суммарные потери after_attack->debris.both=after_attack->debris.attacker; for (i=0; idebris.both)[i]+= ((long long *)&after_attack->debris.defender)[i]; } // количество переработчиков long long all_debris= NORMALIZE_DEBRIS(after_attack->debris.both.all.structure*30/100); long long fleet_debris= NORMALIZE_DEBRIS(after_attack->debris.both.fleet.structure*30/100); if (units[RECYCLER].capacity) { if (all_debris) { after_attack->debris.recyclers.all= all_debris/units[RECYCLER].capacity+1; after_attack->debris.moon.all=all_debris/100000; if (after_attack->debris.moon.all>20) after_attack->debris.moon.all=20; } if (fleet_debris) { after_attack->debris.recyclers.fleet= fleet_debris/units[RECYCLER].capacity+1; after_attack->debris.moon.fleet=fleet_debris/100000; if (after_attack->debris.moon.fleet>20) after_attack->debris.moon.fleet=20; } } } //=================================================================== // возвращает количество взятых ресурсов при текущем capacity //=================================================================== static resource get_resources_from_planet(long long capacity, resource planet) { resource get={0, 0, 0}; int get_res; planet.metal/=2; planet.crystal/=2; planet.deut/=2; if (planet.metalcap3) cap23=cap3; int capacity=cap1; if (cap1attacker.capacity=0; after_attack->defender.capacity=0; for (i=0; iattacker.capacity+= ((long long)units[i].capacity)*after_attack->attacker.unit[i]; after_attack->defender.capacity+= ((long long)units[i].capacity)*after_attack->defender.unit[i]; } // расчитываем сколько атакер взял ресов с планеты after_attack->attacker_plunder=get_resources_from_planet( after_attack->attacker.capacity, before_attack->defender_resource); int req_capacity=get_max_capacity(before_attack->defender_resource); if (after_attack->attacker.capacityattacker.capacity; after_attack->chargo.small= delta_capacity/units[SMALL_CHARGO].capacity; after_attack->chargo.large= delta_capacity/units[LARGE_CHARGO].capacity; after_attack->chargo.small++; after_attack->chargo.large++; } } //=================================================================== // симулирует 6 раундов, возвращает структуру sim_result // с результатами симуляции //=================================================================== static sim_result * simulate6rounds(const sim_info * sim) { int acount, dcount, i, j, round; for (acount=dcount=i=0; iattacker.unit[i]; dcount+=sim->defender.unit[i]; } sim_result *result=calloc(sizeof(sim_result), 1); // если атакующего или дефендера нет, то // возвращаем структуру задания // с одним раундом if ((!acount)||(!dcount)) { result->rounds=1; memcpy(result->attacker.unit, sim->attacker.unit, sizeof(int)*UNITS_COUNT); memcpy(result->defender.unit, sim->defender.unit, sizeof(int)*UNITS_COUNT); result->attacker.count=acount; result->defender.count=dcount; set_who_win(result); set_chargo(result, sim); return result; } // массивы атакующего и обороняющегося unit * attacker=(unit *)calloc(sizeof(unit), acount); unit * defender=(unit *)calloc(sizeof(unit), dcount); // заполняем массивы юнитами for (acount=dcount=i=0; iattacker.unit[i]) { unit u=create_unit(i, sim->attacker.attack, sim->attacker.shield, sim->attacker.armory); for (j=0; jattacker.unit[i]; j++) { attacker[acount++]=u; } } if (sim->defender.unit[i]) { unit u=create_unit(i, sim->defender.attack, sim->defender.shield, sim->defender.armory); for (j=0; jdefender.unit[i]; j++) { defender[dcount++]=u; } } } // 6 раундов for (round=1; round<=MAX_ROUNDS; round++) { simulate_attack(acount, attacker, dcount, defender); simulate_attack(dcount, defender, acount, attacker); acount=normalize_result(acount, attacker); dcount=normalize_result(dcount, defender); if (!(acount && dcount)) break; } if (round>MAX_ROUNDS) round=MAX_ROUNDS; result->rounds=round; // составляем результирующую таблицу какого флота сколько for (i=0; i0) { result->attacker.unit[attacker[i].id]++; } result->attacker.count++; } for (i=0; i0) { result->defender.unit[defender[i].id]++; } result->defender.count++; } free(attacker); free(defender); set_who_win(result); set_debris(result, sim); set_chargo(result, sim); return result; } //=================================================================== // расчитывает средние потери по массиву потерь //=================================================================== static debris * get_average_debris(const psim_result * sims, int sim_count) { debris * result=calloc(sizeof(debris), 1); int i, j; // сумма всех повреждений for (i=0; idebris.ldata_begin; for (j=0; beg_ldebris.ldata_end; j++, beg_l++) result->ldata_begin[j]+=*beg_l; int * beg_i=sims[i]->debris.idata_begin; for (j=0; beg_idebris.idata_end; j++, beg_i++) result->idata_begin[j]+=*beg_i; } // усредняем long long *beg_l = result->ldata_begin; int * beg_i=result->idata_begin; for (j=0; beg_lldata_end; j++, beg_l++) result->ldata_begin[j]/=sim_count; for (j=0; beg_iidata_end; j++, beg_i++) result->idata_begin[j]/=sim_count; return result; } //=================================================================== // делает несколько симуляций // возвращает массив sim_result //=================================================================== static psim_result * simulations(const sim_info * sim, int count) { time_t begin_time; time(&begin_time); if (!count) return 0; int i; psim_result * result= (psim_result *)calloc(sizeof(psim_result), count); for (i=0; iwork_time) continue; time_t current_time; time(¤t_time); if(current_time-begin_time>sim->work_time) break; } return result; } //=================================================================== // усредняет все сделанные симуляции // находит лучший/худший бои аттакера/дефендера итп //=================================================================== sims_result * get_common_results(const psim_result * results, const sim_info * task, int sim_count) { sims_result *sr=calloc(sizeof(sims_result), 1); int i, j, rounds, max_attacker, min_attacker, max_defender, min_defender, max_debris, min_debris; long long metal, crystal, deut, small_chargo, large_chargo; max_attacker=min_attacker=max_defender=min_defender= max_debris=min_debris=0; metal=crystal=deut=0; small_chargo=large_chargo=0; rounds=0; sr->task=*task; sr->rounds.min=sr->rounds.max=results[0]->rounds; sr->sim_count=sim_count; // сумма всех симуляций for (i=0; iattacker.unit[j]+=results[i]->attacker.unit[j]; sr->defender.unit[j]+=results[i]->defender.unit[j]; } // потери/обломки long long *beg_l=results[i]->debris.ldata_begin; for (j=0; beg_ldebris.ldata_end; j++, beg_l++) sr->debris.ldata_begin[j]+=*beg_l; int * beg_i=results[i]->debris.idata_begin; for (j=0; beg_idebris.idata_end; j++, beg_i++) sr->debris.idata_begin[j]+=*beg_i; // минимальные/максимальные потери // атакующего/защитника и вообще if (results[max_attacker]->debris.attacker.all.total< results[i]->debris.attacker.all.total) max_attacker=i; if (results[min_attacker]->debris.attacker.all.total> results[i]->debris.attacker.all.total) min_attacker=i; if (results[max_defender]->debris.defender.all.total< results[i]->debris.defender.all.total) max_defender=i; if (results[min_defender]->debris.defender.all.total> results[i]->debris.defender.all.total) min_defender=i; if (results[max_debris]->debris.both.all.total< results[i]->debris.both.all.total) max_debris=i; if (results[min_debris]->debris.both.all.total> results[i]->debris.both.all.total) min_debris=i; // количество раундов rounds+=results[i]->rounds; if (sr->rounds.min>results[i]->rounds) sr->rounds.min=results[i]->rounds; if (sr->rounds.maxrounds) sr->rounds.max=results[i]->rounds; // количество побед if (results[i]->who_win==ATTACKER_WIN) sr->wins.attacker++; if (results[i]->who_win==DEFENDER_WIN) sr->wins.defender++; // вместимость sr->attacker.capacity+=results[i]->attacker.capacity; sr->defender.capacity+=results[i]->defender.capacity; metal+=results[i]->attacker_plunder.metal; crystal+=results[i]->attacker_plunder.crystal; deut+=results[i]->attacker_plunder.deut; // транспорты small_chargo+=results[i]->chargo.small; large_chargo+=results[i]->chargo.large; } i--; //anilatx:important BUGFIX - after the loop it's one too much! // усредняем результаты // флоты for (j=0; jattacker.unit[j]/=sim_count; sr->defender.unit[j]/=sim_count; } // обломки long long *beg_l=results[i]->debris.ldata_begin; for (j=0; beg_ldebris.ldata_end; j++, beg_l++) sr->debris.ldata_begin[j]/=sim_count; int * beg_i=results[i]->debris.idata_begin; for (j=0; beg_idebris.idata_end; j++, beg_i++) sr->debris.idata_begin[j]/=sim_count; // раунды sr->rounds.average=((double)rounds)/sim_count; sr->best_attacker=*results[min_attacker]; sr->worst_attacker=*results[max_attacker]; sr->best_defender=*results[min_defender]; sr->worst_defender=*results[max_defender]; sr->max_debris=*results[max_debris]; sr->min_debris=*results[min_debris]; // вместимость sr->attacker.capacity/=sim_count; sr->defender.capacity/=sim_count; // забранные ресурсы sr->attacker_plunder.metal=metal/sim_count; sr->attacker_plunder.crystal=crystal/sim_count; sr->attacker_plunder.deut=deut/sim_count; // количество транспортов sr->chargo.small=small_chargo/sim_count; sr->chargo.large=large_chargo/sim_count; return sr; } //=================================================================== // собственно симулятор // Windows-версия //=================================================================== #ifdef __WIN32__ sims_result * simulator(const sim_info * sim) { int i; int sim_count=sim->simulations; // если кого-то нет, то делаем только одну симуляцию // ибо незачем симулировать пустой бой if (!sim->attacker.count || !sim->defender.count) sim_count=1; // считаем psim_result * results=simulations(sim, sim_count); // считаем сколько вышло симуляций for (i=0; iforks_count; int sim_count=sim->simulations; int i, j, acount, dcount, status; acount=sim->attacker.count; dcount=sim->defender.count; // если кого-то нет, то делаем только одну симуляцию // ибо незачем симулировать пустой бой if (!acount || !dcount) { forks_count=0; sim_count=1; } if (sim_count=0; j--) { write(sims[i].writer, psr[j], sizeof(sim_result)); free(psr[j]); } free(psr); exit(0); } // мы в родителе close(sims[i].writer); // ошибка fork if (sims[i].child==-1) { fprintf(stderr, "Error fork: %s\n", strerror(errno)); // прибиваем всех дочек, которых успели создать for (i--; i>=0; i--) { kill(sims[i].child, 15); waitpid(sims[i].child, &status, WUNTRACED); } exit(-1); } } // выделяем место под указатели на резултаты psim_result * results=(psim_result *) calloc(sizeof(psim_result), sim_count); psim_result * ms=simulations(sim, sim_per_main); // основной родитель тоже симулирует (последним потоком) for (i=0; isim_per_fork || count<0) { count=0; } // читаем результаты симуляций for (;count; count--) { sim_result *sr=(sim_result *)malloc(sizeof(sim_result)); if (read(sims[j].reader, sr, sizeof(sim_result))!= sizeof(sim_result)) { // ошибка free(sr); break; } results[i++]=sr; } } // завершаем корректно все процессы for (j=0; j #include #include #include #include "unit.h" #include "units_info.h" #include "parse_input.h" #include "version.h" #include "sim.h" #include "random.h" #include "report.h" int main(int argc, char **argv) { sim_info * sim = parse_input(argc, argv); // инициализируем рандом-генератор числом // зависящим от текущего времени time_t t; srandom( time(&t) ); sims_result * sres=simulator(sim); print_report(sres); free(sim); free(sres); return 0; } ogamesim-20130107/csim/units.conf0000664000000000000000000004313211056522113015215 0ustar rootrootunit12.name = Small Cargo unit12.small_chargo = 1 unit12.order = 0 unit12.structure = 4000 unit12.shield = 10 unit12.attack = 5 unit12.capacity = 5000 unit12.rapid1.name = Solar Satellite unit12.rapid1.value = 5 unit12.rapid2.name = Espionage Probe unit12.rapid2.value = 5 unit12.metal=2000 unit12.crystal=2000 unit16.name = Large Cargo unit16.large_chargo = 1 unit16.order = 1 unit16.structure = 12000 unit16.shield = 25 unit16.attack = 5 unit16.capacity = 25000 unit16.rapid1.name = Solar Satellite unit16.rapid1.value = 5 unit16.rapid2.name = Espionage Probe unit16.rapid2.value = 5 unit16.metal=6000 unit16.crystal=6000 unit17.name = Light Fighter unit17.order = 2 unit17.structure = 4000 unit17.shield = 10 unit17.attack = 50 unit17.capacity = 50 unit17.rapid1.name = Solar Satellite unit17.rapid1.value = 5 unit17.rapid2.name = Espionage Probe unit17.rapid2.value = 5 unit17.metal=3000 unit17.crystal=1000 unit7.name = Heavy Fighter unit7.order = 3 unit7.structure = 10000 unit7.shield = 25 unit7.attack = 150 unit7.capacity = 100 unit7.rapid1.name = Solar Satellite unit7.rapid1.value = 5 unit7.rapid2.name = Espionage Probe unit7.rapid2.value = 5 unit7.rapid3.name = Small Cargo unit7.rapid3.value = 3 unit7.metal=6000 unit7.crystal=4000 unit15.name = Cruiser unit15.order = 4 unit15.structure = 27000 unit15.shield = 50 unit15.attack = 400 unit15.capacity = 800 unit15.rapid1.name = Solar Satellite unit15.rapid1.value = 5 unit15.rapid2.name = Rocket Launcher unit15.rapid2.value = 10 unit15.rapid3.name = Light Fighter unit15.rapid3.value = 6 unit15.rapid4.name = Espionage Probe unit15.rapid4.value = 5 unit15.metal=20000 unit15.crystal=7000 unit15.deut=2000 unit14.name = Battleship unit14.order = 5 unit14.structure = 60000 unit14.shield = 200 unit14.attack = 1000 unit14.capacity = 1500 unit14.rapid1.name = Solar Satellite unit14.rapid1.value = 5 unit14.rapid2.name = Espionage Probe unit14.rapid2.value = 5 unit14.metal=45000 unit14.crystal=15000 unit4.name = Colony Ship unit4.order = 6 unit4.structure = 30000 unit4.shield = 100 unit4.attack = 50 unit4.capacity = 7500 unit4.rapid1.name = Solar Satellite unit4.rapid1.value = 5 unit4.rapid2.name = Espionage Probe unit4.rapid2.value = 5 unit4.metal=10000 unit4.crystal=20000 unit4.deut=10000 unit8.name = Recycler unit8.order = 7 unit8.structure = 16000 unit8.shield = 10 unit8.attack = 1 unit8.capacity = 20000 unit8.rapid1.name = Solar Satellite unit8.rapid1.value = 5 unit8.rapid2.name = Espionage Probe unit8.rapid2.value = 5 unit8.metal=10000 unit8.crystal=6000 unit8.deut=2000 unit8.recycler = 1 unit5.name = Espionage Probe unit5.order = 8 unit5.structure = 1000 unit5.shield = 0.01 unit5.attack = 0.01 unit5.capacity = 0 unit5.crystal=1000 unit9.name = Bomber unit9.order = 9 unit9.structure = 75000 unit9.shield = 500 unit9.attack = 1000 unit9.capacity = 500 unit9.rapid1.name = Ion Cannon unit9.rapid1.value = 10 unit9.rapid2.name = Solar Satellite unit9.rapid2.value = 5 unit9.rapid3.name = Heavy Laser unit9.rapid3.value = 10 unit9.rapid4.name = Light Laser unit9.rapid4.value = 20 unit9.rapid5.name = Rocket Launcher unit9.rapid5.value = 20 unit9.rapid6.name = Espionage Probe unit9.rapid6.value = 5 unit9.metal=50000 unit9.crystal=25000 unit9.deut=15000 unit13.name = Solar Satellite unit13.order = 10 unit13.structure = 2000 unit13.shield = 1 unit13.attack = 1 unit13.crystal=2000 unit13.deut=500 unit20.name = Destroyer unit20.order = 11 unit20.structure = 110000 unit20.shield = 500 unit20.attack = 2000 unit20.capacity = 2000 unit20.rapid1.name = Solar Satellite unit20.rapid1.value = 5 unit20.rapid2.name = Light Laser unit20.rapid2.value = 10 unit20.rapid3.name = Espionage Probe unit20.rapid3.value = 5 unit20.rapid4.name = Battlecruiser unit20.rapid4.value = 2 unit20.metal=60000 unit20.crystal=50000 unit20.deut=15000 unit3.name = Deathstar unit3.order = 12 unit3.structure = 9000000 unit3.metal=5000000 unit3.crystal=4000000 unit3.deut=1000000 unit3.shield = 50000 unit3.attack = 200000 unit3.capacity = 1000000 unit3.rapid1.name = Gauss Cannon unit3.rapid1.value = 50 unit3.rapid2.name = Rocket Launcher unit3.rapid2.value = 200 unit3.rapid3.name = Colony Ship unit3.rapid3.value = 250 unit3.rapid4.name = Espionage Probe unit3.rapid4.value = 1250 unit3.rapid5.name = Ion Cannon unit3.rapid5.value = 100 unit3.rapid6.name = Heavy Fighter unit3.rapid6.value = 100 unit3.rapid7.name = Recycler unit3.rapid7.value = 250 unit3.rapid8.name = Bomber unit3.rapid8.value = 25 unit3.rapid9.name = Light Laser unit3.rapid9.value = 200 unit3.rapid10.name = Heavy Laser unit3.rapid10.value = 100 unit3.rapid11.name = Small Cargo unit3.rapid11.value = 250 unit3.rapid12.name = Solar Satellite unit3.rapid12.value = 1250 unit3.rapid13.name = Battleship unit3.rapid13.value = 30 unit3.rapid14.name = Cruiser unit3.rapid14.value = 33 unit3.rapid15.name = Large Cargo unit3.rapid15.value = 250 unit3.rapid16.name = Light Fighter unit3.rapid16.value = 200 unit3.rapid17.name = Destroyer unit3.rapid17.value = 5 unit3.rapid18.name = Battlecruiser unit3.rapid18.value = 15 unit22.name = Battlecruiser unit22.order = 13 unit22.structure = 70000 unit22.shield = 400 unit22.attack = 700 unit22.capacity = 750 unit22.metal=30000 unit22.crystal=40000 unit22.deut=15000 unit22.rapid1.name = Espionage Probe unit22.rapid1.value = 5 unit22.rapid2.name = Solar Satellite unit22.rapid2.value = 5 unit22.rapid3.name = Small Cargo unit22.rapid3.value = 3 unit22.rapid4.name = Large Cargo unit22.rapid4.value = 3 unit22.rapid5.name = Heavy Fighter unit22.rapid5.value = 4 unit22.rapid6.name = Cruiser unit22.rapid6.value = 4 unit22.rapid7.name = Battleship unit22.rapid7.value = 7 # ground units unit1.name = Rocket Launcher unit1.order = 14 unit1.structure = 2000 unit1.shield = 20 unit1.attack = 80 unit1.ground=1 unit1.metal=2000 unit10.name = Light Laser unit10.order = 15 unit10.structure = 2000 unit10.shield = 25 unit10.attack = 100 unit10.ground=1 unit10.metal=1500 unit10.crystal=500 unit11.name = Heavy Laser unit11.order = 16 unit11.structure = 8000 unit11.shield = 100 unit11.attack = 250 unit11.ground=1 unit11.metal=6000 unit11.crystal=2000 unit2.name = Gauss Cannon unit2.order = 17 unit2.structure = 35000 unit2.shield = 200 unit2.attack = 1100 unit2.ground=1 unit2.metal=20000 unit2.crystal=15000 unit2.deut=2000 unit6.name = Ion Cannon unit6.order = 18 unit6.structure = 8000 unit6.shield = 500 unit6.attack = 150 unit6.ground=1 unit6.metal=2000 unit6.crystal=6000 unit18.name = Plasma Turret unit18.order = 19 unit18.structure = 100000 unit18.shield = 300 unit18.attack = 3000 unit18.ground=1 unit18.metal=50000 unit18.crystal=50000 unit18.deut=30000 unit21.name = Small Shield Dome unit21.order = 20 unit21.structure = 20000 unit21.shield = 2000 unit21.attack = 1 unit21.ground=1 unit21.metal=10000 unit21.crystal=10000 unit19.name = Large Shield Dome unit19.order = 21 unit19.structure = 100000 unit19.shield = 10000 unit19.attack = 1 unit19.ground=1 unit19.metal=50000 unit19.crystal=50000 #Language langs/ca metal.ca = Metall crystal.ca = Cristall deut.ca = Deuteri attack.ca = Tecnologi­a Militar shield.ca = Tecnologi­a de Defensa armory.ca = Tecnologi­a de Blindatje debris.loss.ca = Pérdides debris.max_loss.ca = Pérdides Màximes debris.min_loss.ca = Pérdides Mínimes debris.ca = Escombros debris.min.ca = Escombros (min) debris.max.ca = Escombros (max) attacker.ca = Atacant defender.ca = Defensor unit1.name.ca = Llançamissils unit2.name.ca = Canò Gauss unit3.name.ca = Estrela de la Mort unit4.name.ca = Colonitzador unit5.name.ca = Sonda d'espionatge unit6.name.ca = Canò Iònic unit7.name.ca = Caça Pesat unit8.name.ca = Reciclador unit9.name.ca = Bombarder unit10.name.ca = Làser Petit unit11.name.ca = Làser Gran unit12.name.ca = Nau petita de càrrega unit13.name.ca = Satel.lit Solar unit14.name.ca = Nau de Batalla unit15.name.ca = Creuer unit16.name.ca = Nau gran de càrrega unit17.name.ca = Caça Lleuger unit18.name.ca = Canò de Plasma unit19.name.ca = Cúpula gran de protecció unit20.name.ca = Destructor unit21.name.ca = Cúpula petita de protecció unit22.name.ca = Crucero de Batalla #Language langs/cn metal.cn = 金属 crystal.cn = 晶体 deut.cn = 重氢 attack.cn = 武器技术 shield.cn = 防御盾系统 armory.cn = 装甲技术 debris.loss.cn=损失 debris.max_loss.cn=最大损失 debris.min_loss.cn=最小损失 debris.cn=废墟 debris.min.cn=废墟 (最小) debris.max.cn=废墟 (最大) attacker.cn=进攻者 defender.cn=防守者 unit1.name.cn = 火箭发射装置 unit2.name.cn = 高斯炮 unit3.name.cn = 死星 unit4.name.cn = 殖民船 unit5.name.cn = 探测器 unit6.name.cn = 中子炮 unit7.name.cn = 重型战斗机 unit8.name.cn = 回收船 unit9.name.cn = 轰炸机 unit10.name.cn = 轻型激光炮 unit11.name.cn = 重型激光炮 unit12.name.cn = 小型运输舰 unit13.name.cn = 太阳能卫星 unit14.name.cn = 战列舰 unit15.name.cn = 巡洋舰 unit16.name.cn = 大型运输舰 unit17.name.cn = 轻型战斗机 unit18.name.cn = 等离子武器 unit19.name.cn = 大型防护罩 unit20.name.cn = 毁灭者 unit21.name.cn = 小型防护罩 unit22.name.cn = 战斗巡洋舰 #Language langs/cz # Replace 'LANG' into Your Language-ID (2-letters) # for ex.: metal.en, metal.ru etc # and replace text values AS OGAME text # and save result into file 'cz' (2-letters) # for ex.: en, ru, etc metal.cz = Kov crystal.cz = Krystaly deut.cz = Deuterium attack.cz = Zbraňové systémy shield.cz = Technologie štítů armory.cz = Pancéřování debris.loss.cz=Ztráty debris.max_loss.cz=Maximální ztráty debris.min_loss.cz=Minimání ztráty debris.cz=Trosky debris.min.cz=Trosky (min) debris.max.cz=Trosky (max) attacker.cz=Útočník defender.cz=Obránce unit1.name.cz = Raketomet unit2.name.cz = Gauss kanón unit3.name.cz = Hvězda smrti unit4.name.cz = Kolonizační loď unit5.name.cz = Špionážní sonda unit6.name.cz = Ion kanón unit7.name.cz = Těžký stíhač unit8.name.cz = Recyklátor unit9.name.cz = Bombardér unit10.name.cz = Lehký laser unit11.name.cz = Těžký laser unit12.name.cz = Malý transportér unit13.name.cz = Solární satelit unit14.name.cz = Bitevní loď unit15.name.cz = Křižník unit16.name.cz = Velký transportér unit17.name.cz = Lehký stíhač unit18.name.cz = Plasmová věž unit19.name.cz = Velký planetární štít unit20.name.cz = Destroyer unit21.name.cz = Málý planetární štít unit22.name.cz = Bitevní křižník #Language langs/de # Replace 'de' into You language-ID (2-letters) # for ex.: metal.en, metal.ru etc # and replace text values AS OGAME text # and save result into file 'lang' (2-letters) # for ex.: en, ru, etc metal.de = Metall crystal.de = Kristall deut.de = Deuterium attack.de = Waffentechnik shield.de = Schildtechnik armory.de = Raumschiffpanzerung debris.loss.de=Verluste debris.max_loss.de=Verluste (max) debris.min_loss.de=Verluste (min) debris.de=Trümmerfeld debris.min.de=Trümmerfeld (min) debris.max.de=Trümmerfeld (max) attacker.de=Angreifer defender.de=Verteidiger unit1.name.de = Raketenwerfer unit2.name.de = Gaußkanone unit3.name.de = Todesstern unit4.name.de = Kolonieschiff unit5.name.de = Spionagesonde unit6.name.de = Ionengeschütz unit7.name.de = Schwerer Jäger unit8.name.de = Recycler unit9.name.de = Bomber unit10.name.de = Leichtes Lasergeschütz unit11.name.de = Schweres Lasergeschütz unit12.name.de = Kleiner Transporter unit13.name.de = Solarsatellit unit14.name.de = Schlachtschiff unit15.name.de = Kreuzer unit16.name.de = Großer Transporter unit17.name.de = Leichter Jäger unit18.name.de = Plasmawerfer unit19.name.de = Große Schildkuppel unit20.name.de = Zerstörer unit21.name.de = Kleine Schildkuppel unit22.name.de = Schlachtkreuzer #Language langs/en metal.en = Metal crystal.en = Crystal deut.en = Deuterium attack.en = Weapons Technology shield.en = Shielding Technology armory.en = Armour Technology debris.loss.en=Losses debris.max_loss.en=Maximum losses debris.min_loss.en=Minimum losses debris.en=Debris debris.min.en=Debris (min) debris.max.en=Debris (max) attacker.en=Attacker defender.en=Defender unit1.name.en = Rocket Launcher unit2.name.en = Gauss Cannon unit3.name.en = Deathstar unit4.name.en = Colony Ship unit5.name.en = Espionage Probe unit6.name.en = Ion Cannon unit7.name.en = Heavy Fighter unit8.name.en = Recycler unit9.name.en = Bomber unit10.name.en = Light Laser unit11.name.en = Heavy Laser unit12.name.en = Small Cargo unit13.name.en = Solar Satellite unit14.name.en = Battleship unit15.name.en = Cruiser unit16.name.en = Large Cargo unit17.name.en = Light Fighter unit18.name.en = Plasma Turret unit19.name.en = Large Shield Dome unit20.name.en = Destroyer unit21.name.en = Small Shield Dome unit22.name.en = Battlecruiser #Language langs/fr # Replace 'LANG' into You language-ID (2-letters) # for ex.: metal.en, metal.ru etc # and replace text values AS OGAME text # and save result into file 'lang' (2-letters) # for ex.: en, ru, etc metal.fr = Métal crystal.fr = Cristal deut.fr = Deutérium attack.fr = Technologie Armes shield.fr = Technologie Bouclier armory.fr = Technologie Protection des vaisseaux spatiaux debris.loss.fr = pertes debris.max_loss.fr = Pertes maximales debris.min_loss.fr = Pertes minimales debris.fr = Débris debris.min.fr = Débris (min) debris.max.fr = Débris (max) attacker.fr = Attaquant defender.fr =Défenseur unit1.name.fr = Lanceur de missiles unit2.name.fr = Canon de Gauss unit3.name.fr = Étoile de la mort unit4.name.fr = Vaisseau de colonisation unit5.name.fr = Sonde espionnage unit6.name.fr = Artillerie à ions unit7.name.fr = Chasseur lourd unit8.name.fr = Recycleur unit9.name.fr = Bombardier unit10.name.fr = Artillerie laser légère unit11.name.fr = Artillerie laser lourde unit12.name.fr = Petit transporteur unit13.name.fr = Satellite solaire unit14.name.fr = Vaisseau de bataille unit15.name.fr = Croiseur unit16.name.fr = Grand transporteur unit17.name.fr = Chasseur léger unit18.name.fr = Lanceur de plasma unit19.name.fr = Grand bouclier unit20.name.fr = Destructeur unit21.name.fr = Petit bouclier unit22.name.fr = Battlecruiser #Language langs/pl metal.pl = Metal crystal.pl = Kryształ deut.pl = Deuter attack.pl = Technologia bojowa shield.pl = Technologia ochronna armory.pl = Opancerzenie debris.loss.pl=Straty debris.max_loss.pl=Maksymalne straty debris.min_loss.pl=Minimalne straty debris.pl=Szczątki debris.min.pl=Szczątki (min) debris.max.pl=Szczątki (maks) attacker.pl=Agresor defender.pl=Obrońca unit1.name.pl = Wyrzutnia rakiet unit2.name.pl = Działo Gaussa unit3.name.pl = Gwiazda Śmierci unit4.name.pl = Statek kolonizacyjny unit5.name.pl = Sonda szpiegowska unit6.name.pl = Działo jonowe unit7.name.pl = Ciężki myśliwiec unit8.name.pl = Recykler unit9.name.pl = Bombowiec unit10.name.pl = Lekkie działo laserowe unit11.name.pl = Ciężkie działo laserowe unit12.name.pl = Mały transporter unit13.name.pl = Satelita słoneczny unit14.name.pl = Okręt wojenny unit15.name.pl = Krążownik unit16.name.pl = Duży transporter unit17.name.pl = Lekki myśliwiec unit18.name.pl = Wyrzutnia plazmy unit19.name.pl = Duża powłoka ochronna unit20.name.pl = Niszczyciel unit21.name.pl = Mała powłoka ochronna unit22.name.pl = Pancernik #Language langs/ru metal.ru = металла crystal.ru = кристалла deut.ru = дейтерия attack.ru = Оружейная технология shield.ru = Щитовая технология armory.ru = Броня космических кораблей debris.loss.ru=Потери debris.max_loss.ru=Максимальные потери debris.min_loss.ru=Минимальные потери debris.ru=Обломки debris.min.ru=Обломки (минимум) debris.max.ru=Обломки (максимум) attacker.ru=Атакующий defender.ru=Защитник unit1.name.ru = Ракетная установка unit2.name.ru = Пушка Гаусса unit3.name.ru = Звезда смерти unit4.name.ru = Колонизатор unit5.name.ru = Шпионский зонд unit6.name.ru = Ионное орудие unit7.name.ru = Тяжёлый истребитель unit8.name.ru = Переработчик unit9.name.ru = Бомбардировщик unit10.name.ru = Лёгкий лазер unit11.name.ru = Тяжёлый лазер unit12.name.ru = Малый транспорт unit13.name.ru = Солнечный спутник unit14.name.ru = Линкор unit15.name.ru = Крейсер unit16.name.ru = Большой транспорт unit17.name.ru = Лёгкий истребитель unit18.name.ru = Плазменное орудие unit19.name.ru = Большой щитовой купол unit20.name.ru = Уничтожитель unit21.name.ru = Малый щитовой купол unit22.name.ru = Линейный крейсер #Language langs/sp metal.sp = Metal crystal.sp = Cristal deut.sp = Deuterio attack.sp = Tecnología Militar shield.sp = Tecnología de Defensa armory.sp = Tecnología de Blindaje debris.loss.sp=Pérdidas debris.max_loss.sp=Pérdidas máximas debris.min_loss.sp=Pérdidas mínimas debris.sp=Escombros debris.min.sp=Escombros (min) debris.max.sp=Escombros (max) attacker.sp=Atacante defender.sp=Defensor unit1.name.sp = Lanzamisiles unit2.name.sp = Cañón Gauss unit3.name.sp = Estrella de la Muerte unit4.name.sp = Colonizador unit5.name.sp = Sonda de espionaje unit6.name.sp = Cañón Iónico unit7.name.sp = Cazador Pesado unit8.name.sp = Reciclador unit9.name.sp = Bombardero unit10.name.sp = Láser Pequeño unit11.name.sp = Láser Grande unit12.name.sp = Nave pequeña de carga unit13.name.sp = Satélite Solar unit14.name.sp = Nave de Batalla unit15.name.sp = Crucero unit16.name.sp = Nave grande de carga unit17.name.sp = Cazador Ligero unit18.name.sp = Cañón de Plasma unit19.name.sp = Cúpula grande de protección unit20.name.sp = Destructor unit21.name.sp = Cúpula pequeña de protección unit22.name.sp = Crucero de Batalla ogamesim-20130107/csim/report.c0000664000000000000000000001551511056522520014671 0ustar rootroot/* Copyright (C) by Dmitry E. Oboukhov 2006, 2007 This package is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this package; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include "report.h" #ifdef __WIN32__ #define LPF "%I64d" #else #define LPF "%lld" #endif //=================================================================== // печатает флоты атакующего и защитника //=================================================================== static void print_fleets(const int *attacker, const int *defender) { int i; printf("\tAttacker\n"); for (i=0; iattacker.unit, sr->defender.unit); } //=================================================================== // Печатает результаты симуляции (задание) //=================================================================== static void print_simulate_task(const sim_info * sim, const char *title, int print_resources) { int i; printf("\n[%s]\n", title); print_fleets(sim->attacker.unit, sim->defender.unit); if (print_resources) { printf("\n\t\t%20s: %d\n", "Defender metal", sim->defender_resource.metal); printf("\t\t%20s: %d\n", "Defender crystal", sim->defender_resource.crystal); printf("\t\t%20s: %d\n", "Defender deut", sim->defender_resource.deut); } } //=================================================================== // печатает средний результат //=================================================================== static void print_average(const sims_result * sr) { int i; printf("\n[Average simulation]\n\tAttacker\n"); for (i=0; itask.attacker.unit[i]) { printf("\t\t%20s: %-8.2lf\n", units[i].name, sr->attacker.unit[i]); } } printf("\tDefender\n"); for (i=0; itask.defender.unit[i]) { printf("\t\t%20s: %-8.2lf\n", units[i].name, sr->defender.unit[i]); } } printf("\n[Average capacity after combat]\n"); printf("Attacker: " LPF "\nDefender: " LPF "\n", sr->attacker.capacity, sr->defender.capacity); resource max_res=sr->task.defender_resource; max_res.metal>>=1; max_res.crystal>>=1; max_res.deut>>=1; int max_total=max_res.metal+max_res.crystal+max_res.deut; int total=sr->attacker_plunder.metal+ sr->attacker_plunder.crystal+sr->attacker_plunder.deut; printf("\n[Attacker plunder]\n"); printf( " Metal: %10d (%3d%%)\n" "Crystal: %10d (%3d%%)\n" " Deut: %10d (%3d%%)\n" " Total: %10d (%3d%%)\n" "Needed Small chargo: %d\n" "Needed Large chargo: %d\n", sr->attacker_plunder.metal, max_res.metal?sr->attacker_plunder.metal*100/max_res.metal:100, sr->attacker_plunder.crystal, max_res.crystal?sr->attacker_plunder.crystal*100/max_res.crystal:100, sr->attacker_plunder.deut, max_res.deut?sr->attacker_plunder.deut*100/max_res.deut:100, total, max_total?total*100/max_total:100, sr->chargo.small, sr->chargo.large); } //=================================================================== // печатает инфу о потерях //=================================================================== static void print_debris(const debris *dbr, const char *title) { printf("\n[%s]\n", title); printf( "Attacker loss: metal=" LPF " crystal=" LPF " deuterium=" LPF "\n" "Defender loss: metal=" LPF " crystal=" LPF " deuterium=" LPF "\n" "Common loss: metal=" LPF " crystal=" LPF " deuterium=" LPF "\n\n" "Debris with ground: metal=" LPF " crystal=" LPF "\n" "Debris without ground: metal=" LPF " crystal=" LPF "\n", dbr->attacker.all.metal, dbr->attacker.all.crystal, dbr->attacker.all.deut, dbr->defender.all.metal, dbr->defender.all.crystal, dbr->defender.all.deut, dbr->both.all.metal, dbr->both.all.crystal, dbr->both.all.deut, NORMALIZE_DEBRIS(dbr->both.all.metal*30/100), NORMALIZE_DEBRIS(dbr->both.all.crystal*30/100), NORMALIZE_DEBRIS(dbr->both.fleet.metal*30/100), NORMALIZE_DEBRIS(dbr->both.fleet.crystal*30/100) ); printf( "Recyclers with ground: " LPF "\nRecyclers without ground: " LPF "\n", dbr->recyclers.all, dbr->recyclers.fleet); printf( "Chance moon with ground: %d%%\n" "Chance moon without ground: %d%%\n", dbr->moon.all, dbr->moon.fleet); } //=================================================================== // печатает результаты симуляции //=================================================================== void print_report(const sims_result *sr) { print_simulate_task(&sr->task, "Simulate task", 1); printf("\n[Simulate info]\n"); printf("Rounds: %1.2lf (%d, %d)\n", sr->rounds.average, sr->rounds.min, sr->rounds.max); printf("Simulations: %d\n", sr->sim_count); printf("Attacker win: %d/%d (%d%%)\n", sr->wins.attacker, sr->sim_count, 100*sr->wins.attacker/sr->sim_count); printf("Defender win: %d/%d (%d%%)\n", sr->wins.defender, sr->sim_count, 100*sr->wins.defender/sr->sim_count); printf("\n[Best attacker]\n"); print_fleets_result(&sr->best_attacker); printf("\n[Worst attacker]\n"); print_fleets_result(&sr->worst_attacker); printf("\n[Best defender]\n"); print_fleets_result(&sr->best_defender); printf("\n[Worst defender]\n"); print_fleets_result(&sr->worst_defender); print_debris(&sr->debris, "Average debris"); print_debris(&sr->min_debris.debris, "Minimum debris"); print_debris(&sr->max_debris.debris, "Maximum debris"); print_average(sr); } //=================================================================== ogamesim-20130107/csim/units_info.c0000664000000000000000000002655211056522520015536 0ustar rootroot/* Copyright (C) by Dmitry E. Oboukhov 2006, 2007 This package is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this package; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Этот файл сгенерирован при помощи утилиты 'create_units.pl' поэтому менять его руками не стоит. При генерации данные взяты из файла 'units.conf' */ #include "unit.h" /* Oбщее описание юнитов */ unit_info units[]= { { "Small Cargo" /* name */, 10 /* shield */, 4000 /* structure */, 5 /* attack */, 5000 /* capacity */, 2000 /* metal */, 2000 /* crystal */, 0 /* deut */, { 0 /* ground */, 0 /* large_chargo */, 1 /* small_chargo */, 0 /* recycler */, }, 1 /* rapidno */ }, { "Large Cargo" /* name */, 25 /* shield */, 12000 /* structure */, 5 /* attack */, 25000 /* capacity */, 6000 /* metal */, 6000 /* crystal */, 0 /* deut */, { 0 /* ground */, 1 /* large_chargo */, 0 /* small_chargo */, 0 /* recycler */, }, 2 /* rapidno */ }, { "Light Fighter" /* name */, 10 /* shield */, 4000 /* structure */, 50 /* attack */, 50 /* capacity */, 3000 /* metal */, 1000 /* crystal */, 0 /* deut */, { 0 /* ground */, 0 /* large_chargo */, 0 /* small_chargo */, 0 /* recycler */, }, 3 /* rapidno */ }, { "Heavy Fighter" /* name */, 25 /* shield */, 10000 /* structure */, 150 /* attack */, 100 /* capacity */, 6000 /* metal */, 4000 /* crystal */, 0 /* deut */, { 0 /* ground */, 0 /* large_chargo */, 0 /* small_chargo */, 0 /* recycler */, }, 4 /* rapidno */ }, { "Cruiser" /* name */, 50 /* shield */, 27000 /* structure */, 400 /* attack */, 800 /* capacity */, 20000 /* metal */, 7000 /* crystal */, 2000 /* deut */, { 0 /* ground */, 0 /* large_chargo */, 0 /* small_chargo */, 0 /* recycler */, }, 5 /* rapidno */ }, { "Battleship" /* name */, 200 /* shield */, 60000 /* structure */, 1000 /* attack */, 1500 /* capacity */, 45000 /* metal */, 15000 /* crystal */, 0 /* deut */, { 0 /* ground */, 0 /* large_chargo */, 0 /* small_chargo */, 0 /* recycler */, }, 6 /* rapidno */ }, { "Colony Ship" /* name */, 100 /* shield */, 30000 /* structure */, 50 /* attack */, 7500 /* capacity */, 10000 /* metal */, 20000 /* crystal */, 10000 /* deut */, { 0 /* ground */, 0 /* large_chargo */, 0 /* small_chargo */, 0 /* recycler */, }, 7 /* rapidno */ }, { "Recycler" /* name */, 10 /* shield */, 16000 /* structure */, 1 /* attack */, 20000 /* capacity */, 10000 /* metal */, 6000 /* crystal */, 2000 /* deut */, { 0 /* ground */, 0 /* large_chargo */, 0 /* small_chargo */, 1 /* recycler */, }, 8 /* rapidno */ }, { "Espionage Probe" /* name */, 0 /* shield */, 1000 /* structure */, 0 /* attack */, 0 /* capacity */, 0 /* metal */, 1000 /* crystal */, 0 /* deut */, { 0 /* ground */, 0 /* large_chargo */, 0 /* small_chargo */, 0 /* recycler */, }, 0 /* rapidno */ }, { "Bomber" /* name */, 500 /* shield */, 75000 /* structure */, 1000 /* attack */, 500 /* capacity */, 50000 /* metal */, 25000 /* crystal */, 15000 /* deut */, { 0 /* ground */, 0 /* large_chargo */, 0 /* small_chargo */, 0 /* recycler */, }, 9 /* rapidno */ }, { "Solar Satellite" /* name */, 1 /* shield */, 2000 /* structure */, 1 /* attack */, 0 /* capacity */, 0 /* metal */, 2000 /* crystal */, 500 /* deut */, { 0 /* ground */, 0 /* large_chargo */, 0 /* small_chargo */, 0 /* recycler */, }, 0 /* rapidno */ }, { "Destroyer" /* name */, 500 /* shield */, 110000 /* structure */, 2000 /* attack */, 2000 /* capacity */, 60000 /* metal */, 50000 /* crystal */, 15000 /* deut */, { 0 /* ground */, 0 /* large_chargo */, 0 /* small_chargo */, 0 /* recycler */, }, 10 /* rapidno */ }, { "Deathstar" /* name */, 50000 /* shield */, 9000000 /* structure */, 200000 /* attack */, 1000000 /* capacity */, 5000000 /* metal */, 4000000 /* crystal */, 1000000 /* deut */, { 0 /* ground */, 0 /* large_chargo */, 0 /* small_chargo */, 0 /* recycler */, }, 11 /* rapidno */ }, { "Battlecruiser" /* name */, 400 /* shield */, 70000 /* structure */, 700 /* attack */, 750 /* capacity */, 30000 /* metal */, 40000 /* crystal */, 15000 /* deut */, { 0 /* ground */, 0 /* large_chargo */, 0 /* small_chargo */, 0 /* recycler */, }, 12 /* rapidno */ }, { "Rocket Launcher" /* name */, 20 /* shield */, 2000 /* structure */, 80 /* attack */, 0 /* capacity */, 2000 /* metal */, 0 /* crystal */, 0 /* deut */, { 1 /* ground */, 0 /* large_chargo */, 0 /* small_chargo */, 0 /* recycler */, }, 0 /* rapidno */ }, { "Light Laser" /* name */, 25 /* shield */, 2000 /* structure */, 100 /* attack */, 0 /* capacity */, 1500 /* metal */, 500 /* crystal */, 0 /* deut */, { 1 /* ground */, 0 /* large_chargo */, 0 /* small_chargo */, 0 /* recycler */, }, 0 /* rapidno */ }, { "Heavy Laser" /* name */, 100 /* shield */, 8000 /* structure */, 250 /* attack */, 0 /* capacity */, 6000 /* metal */, 2000 /* crystal */, 0 /* deut */, { 1 /* ground */, 0 /* large_chargo */, 0 /* small_chargo */, 0 /* recycler */, }, 0 /* rapidno */ }, { "Gauss Cannon" /* name */, 200 /* shield */, 35000 /* structure */, 1100 /* attack */, 0 /* capacity */, 20000 /* metal */, 15000 /* crystal */, 2000 /* deut */, { 1 /* ground */, 0 /* large_chargo */, 0 /* small_chargo */, 0 /* recycler */, }, 0 /* rapidno */ }, { "Ion Cannon" /* name */, 500 /* shield */, 8000 /* structure */, 150 /* attack */, 0 /* capacity */, 2000 /* metal */, 6000 /* crystal */, 0 /* deut */, { 1 /* ground */, 0 /* large_chargo */, 0 /* small_chargo */, 0 /* recycler */, }, 0 /* rapidno */ }, { "Plasma Turret" /* name */, 300 /* shield */, 100000 /* structure */, 3000 /* attack */, 0 /* capacity */, 50000 /* metal */, 50000 /* crystal */, 30000 /* deut */, { 1 /* ground */, 0 /* large_chargo */, 0 /* small_chargo */, 0 /* recycler */, }, 0 /* rapidno */ }, { "Small Shield Dome" /* name */, 2000 /* shield */, 20000 /* structure */, 1 /* attack */, 0 /* capacity */, 10000 /* metal */, 10000 /* crystal */, 0 /* deut */, { 1 /* ground */, 0 /* large_chargo */, 0 /* small_chargo */, 0 /* recycler */, }, 0 /* rapidno */ }, { "Large Shield Dome" /* name */, 10000 /* shield */, 100000 /* structure */, 1 /* attack */, 0 /* capacity */, 50000 /* metal */, 50000 /* crystal */, 0 /* deut */, { 1 /* ground */, 0 /* large_chargo */, 0 /* small_chargo */, 0 /* recycler */, }, 0 /* rapidno */ }, }; /* Скорострелы */ rapidfire rapids[13][19]= { { { 0, 0, 0 }, }, /* Small Cargo */ { { 10, 5, 0.8 }, { 8, 5, 0.8 }, }, /* Large Cargo */ { { 10, 5, 0.8 }, { 8, 5, 0.8 }, }, /* Light Fighter */ { { 10, 5, 0.8 }, { 8, 5, 0.8 }, }, /* Heavy Fighter */ { { 10, 5, 0.8 }, { 8, 5, 0.8 }, { 0, 3, 0.666666666666667 }, }, /* Cruiser */ { { 10, 5, 0.8 }, { 14, 10, 0.9 }, { 2, 6, 0.833333333333333 }, { 8, 5, 0.8 }, }, /* Battleship */ { { 10, 5, 0.8 }, { 8, 5, 0.8 }, }, /* Colony Ship */ { { 10, 5, 0.8 }, { 8, 5, 0.8 }, }, /* Recycler */ { { 10, 5, 0.8 }, { 8, 5, 0.8 }, }, /* Bomber */ { { 18, 10, 0.9 }, { 10, 5, 0.8 }, { 16, 10, 0.9 }, { 15, 20, 0.95 }, { 14, 20, 0.95 }, { 8, 5, 0.8 }, }, /* Destroyer */ { { 10, 5, 0.8 }, { 15, 10, 0.9 }, { 8, 5, 0.8 }, { 13, 2, 0.5 }, }, /* Deathstar */ { { 17, 50, 0.98 }, { 14, 200, 0.995 }, { 6, 250, 0.996 }, { 8, 1250, 0.9992 }, { 18, 100, 0.99 }, { 3, 100, 0.99 }, { 7, 250, 0.996 }, { 9, 25, 0.96 }, { 15, 200, 0.995 }, { 16, 100, 0.99 }, { 0, 250, 0.996 }, { 10, 1250, 0.9992 }, { 5, 30, 0.966666666666667 }, { 4, 33, 0.96969696969697 }, { 1, 250, 0.996 }, { 2, 200, 0.995 }, { 11, 5, 0.8 }, { 13, 15, 0.933333333333333 }, }, /* Battlecruiser */ { { 8, 5, 0.8 }, { 10, 5, 0.8 }, { 0, 3, 0.666666666666667 }, { 1, 3, 0.666666666666667 }, { 3, 4, 0.75 }, { 4, 4, 0.75 }, { 5, 7, 0.857142857142857 }, }, }; ogamesim-20130107/csim/unit.c0000664000000000000000000001011612072357373014340 0ustar rootroot/* Copyright (C) by Dmitry E. Oboukhov 2006, 2007 This package is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this package; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include "unit.h" #include "units_info.h" #include "random.h" #define DEBUG_FIRE 0 //=================================================================== // производит симуляцию одного юнита (против одного юнита) // возвращает истину если можно еще раз атаковать //=================================================================== int attack_unit(const unit * attacker, unit * defender) { int power=attacker->attack; if (DEBUG_FIRE) { printf("'%s' attack (power %d) to\n\t" "'%s' (shield %d/%d, armory %d/%d)", units[attacker->id].name, attacker->attack, units[defender->id].name, defender->shield, defender->max.shield, defender->armory, defender->max.armory ); } // если щиты выстрел не отражают if (defender->max.shieldshield==0)//anilatx: this affects calculations, reflection rule is about max.shield. { // вся мощность ушла в щиты if (defender->shield && defender->shield>=power) { defender->shield-=power; power=0; } // часть мощности ушла в щиты else { power-=defender->shield; defender->shield=0; } // расчитываем урон в структуре // убит выстрелом if (power>=defender->armory) { defender->armory=0; } // мощность выстрела меньше мощности структуры else if (power) { defender->armory-=power; if (((defender->max.armory*70)/100)>=defender->armory) { int level_boom=100*defender->armory/defender->max.armory; if (random()%100>level_boom) { // boom! defender->armory=0; } } } } if (DEBUG_FIRE) { if (defender->armory) printf("\n"); else printf (", killed!\n"); } // вычисляем можно ли стрелять еще раз int rid=units[attacker->id].rapid; int i; if (rid==0) return 0; for (i=0; rapids[rid][i].rf; i++) { // если стреляли по чуду против которого у нас есть скорострел // то вычисляем вероятность следующего выстрела if (rapids[rid][i].id==defender->id) { return random()=sizeof(units)/sizeof(unit_info)) { fprintf(stderr, "error id unit '%d' in function create_unit", id); exit(-1); } u.id=id; u.max.shield=units[id].shield; u.max.armory=units[id].structure/10; u.attack=units[id].attack; u.max.shield+=u.max.shield*gshield/10; u.max.armory+=u.max.armory*garmory/10; u.attack+=u.attack*gattack/10; u.shield=u.max.shield; u.armory=u.max.armory; return u; } //=================================================================== ogamesim-20130107/csim/version.h0000664000000000000000000000145511056522520015046 0ustar rootroot/* Copyright (C) by Dmitry E. Oboukhov 2006, 2007 This package is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this package; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __VERSION__H__ #define VERSION "1.17" #endif ogamesim-20130107/csim/Makefile0000664000000000000000000000537410537102024014650 0ustar rootrootSRC = $(wildcard *.c) OBJ = $(SRC:%.c=obj/%.o) SO_OBJ = $(filter-out main.o,$(OBJ)) WOBJ = $(SRC:%.c=obj/%.obj) DLL_OBJ = $(filter-out main.obj,$(WOBJ)) UMASK = 022 TIMECMD = /usr/bin/time -p # цель для Linux (для венды будет с суффиксом .exe) TARGET = csim # флаги линуксового компилятора CCFLAGS = -MMD -g -O2 -fomit-frame-pointer # флаги виндового компилятора WCCFLAGS = -g -O2 -D__WIN32__ -fomit-frame-pointer SIZE = size WSIZE = i586-mingw32msvc-size # линуксовый компилятор CC = gcc # виндовый компилятор WCC = i586-mingw32msvc-gcc WLIBS = # по умолчанию собираем для линукс только all: for_linux # сборка под все платформы all_targets: for_linux for_win32 # сборка для линукс for_linux: $(TARGET) #$(TARGET).so # сборка для венды for_win32: $(TARGET).exe # csim (static) $(TARGET): $(OBJ) umask $(UMASK) && $(CC) $(OBJ) -o $@ $(SIZE) $@ # csim.so $(TARGET).so: $(SO_OBJ) umask $(UMASK) && $(CC) $(SO_OBJ) -o $@ -shared -nostartfiles $(SIZE) $@ # csim.dll $(TARGET).dll: $(DLL_OBJ) $(WCC) $(DLL_OBJ) -o $@ -shared $(WSIZE) $@ # csim_wl.exe (dynamic) $(TARGET)_wl.exe: obj/main.obj $(TARGET).dll $(WCC) obj/main.obj $(TARGET).dll -o $@ $(WSIZE) $@ # csim_wl (dynamic) $(TARGET)_wl: $(TARGET).so umask $(UMASK) && $(CC) obj/main.o $< -o $@ # csim.exe (static) $(TARGET).exe: $(WOBJ) $(WCC) $(WOBJ) -o $@ -static $(WLIBS) $(WSIZE) $@ obj/%.obj: %.c Makefile -@mkdir -p obj $(WCC) -c $(WCCFLAGS) $< -o $@ obj/%.o: %.c Makefile -@mkdir -p obj $(CC) -c $(CCFLAGS) $< -o $@ units.conf: $(wildcard langs/??) base_units.conf umask 022 && \ cp -f base_units.conf $@ for lang in $(wildcard langs/??); do \ echo -e "\n\n#Language $$lang\n" >> $@; \ cat $$lang >> $@; \ done units_info.c: units.conf create_units.pl units_info.h Makefile perl create_units.pl $< -c $@ -h /dev/null units_info.h: units.conf create_units.pl Makefile perl create_units.pl $< -h $@ -c /dev/null clean: rm -fr obj open_project: ifeq ($(TERM),screen) @if [ -e .Makefile.swp ]; then \ echo "Проект уже открыт!"; \ else \ for i in Makefile units.conf create_units.pl *.[ch]; do \ screen -t $$i vim $$i; sleep 0.5; \ done; \ fi else @echo проект открывается только под screen endif test: $(TARGET) $(TIMECMD) ./$(TARGET) -s 100 -f 3 -i tests/test1.txt test2: $(TARGET) $(TIMECMD) ./$(TARGET) -t 3 -s 100 -f 3 -i tests/test2.txt test3: $(TARGET) $(TIMECMD) ./$(TARGET) -s 100 -f 3 -i tests/test3.txt include $(wildcard obj/*.d) .PHONY: all clean test test2 test3 open_project for_linux for_win32 all_targets ogamesim-20130107/csim/cargocap.png0000664000000000000000000002035710453257053015505 0ustar rootrootPNG  IHDRG gAMA a IDATx^]8μA"V\7ԡC`o|N$=`@B T ! @d "6BA! Z! JmB@(J! !(I# J} |˗/>|xVB@: ?@ϟ?G" nhK>-JO!0 Q$N;t,R7MCQ,/r"d{UFΊs9P*uA l J$Ya!m)8)C(('ºd^Qj%dD =xD)a$J#wdծV NNFY3,zյa-}Dkء²D* ?6 r_ο8*m#NsƙV=cRZ"p\bֹν}!gqʒ ųgΞLOPddPj|8!i'BU8$\N/L< Rh.ch$ȪYH2on>[~dI"yq<j:PW+ $,{ʤ ( rwh$%ÜV2D,U&t#5+82R/풌p JpD˘ nj`!\|@>Ki(JEàDB@R4\Q2&(X(>xRA?lbQ05m, A@) "JʥDﳹ4iX: jM$D(uKe.cnRArEϟw Q& (_|oct :vN \'3"O>Rse|"a{ڒ!7R*1_.q2.gKB%%}#;mD}'U>eSE@?Dϟ_J؟Pn@ӿۿX?~,GRG`JES_GdzCz'EP*TpVM|Ҳ1[u^(uTobD T-Pm؟PR/}Ҏz:RG=zDLO(RE@@5XNFPJD#rJk΂B`BQrJ<)U[Nܡa/؟PRQ;W-~!0 QRۨЮVR|a+r|+)  x$#J-a]*hmUZJ"-mW2`#܋R{[a|4]z0B'cR>LP#"o,V?FXz>` ]oNA !co(JcTL;w Ύ_lzu'#:xb3QCLOf I<BPE#.NЭ>#IkJy>ۋ6}C-@mxB{BcJR⸴՝w.2Hٟw$5mjF5obu-$Alb_x>mù"& dj&"5 0E9}_Ќ G#\8)GhAA}Ӌ1x9WuU,T`ut3CDh^.x{pK|_y)Y;m3"Imx9'``1nkR*@ Ѿ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+%2R7t%P DVRQ F| ]G+ +( J)6 T~QHϛg>@yC{d*L1&(u@fk J]=؀6P5BR2F'Q6 T0Y 4Ccl?|)6CоoDd8·໼8(u"ހ6PS@1 |6 ߾}#1cYC:F^YbCe)$jz5퀢Զx8| wٸcGJJO eiI&ÊR *` -6":}q@ =ĴD*ՠdt˂ۧdUgu9l2:y!Wɭ6 T8{Bx|bqdn+o) R۶R8'FDraTޤ*8 o"d RAij̷J2Pl>0|TZ1dj":nIIWcDXYhUHr NaxȥYM]ƥY( $_O {,M N؀alA":TC{(u my`-H&7I:8U{oOu+Jm,E@ $ϧ(JSٝHjaXEM]]2] oܽ>RF|m+=. huROxaL@ En;g^hPMj%I@Ts9a+DZúlG{S9 X)(DM|4vB8R҃.@QH=@u17 TX'$M7Dݠ]f hq Qj_|W}> /٭d}`J1qÃM. ! J7T16G!y@6la]3_|]$R4oJmkF"uX{W >ǮQ&z˽YGE[]3mmׇk(J}kxG T9,&N};QMuv~?h~Ra5eI)M {v/2T(uծy-Rbi)D@B@Q[,-=(uȚB J}YS! JIENDB`ogamesim-20130107/csim/unit.h0000664000000000000000000000503511056522520014336 0ustar rootroot/* Copyright (C) by Dmitry E. Oboukhov 2006, 2007 This package is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this package; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __UNIT__H__ #define __UNIT__H__ // структура, описывающая скорострел typedef struct { int id; // идентификатор против кого (в info) скорострел int rf; // игровое значение скорострела double chance; // вычисленный шанс на сл. выстрел } rapidfire; // массив структур информации о юнитах // (читается из конфиг-файла) // id - в остальных структурах - индекс в этом массиве typedef struct { char name[64]; int shield, structure, attack, capacity; int metal, crystal, deut; // стоимость юнита struct { unsigned int ground:1; // 1 = наземное сооружение unsigned int large_chargo:1; // 1 = большой транспорт unsigned int small_chargo:1; // 1 = малый транспорт unsigned int recycler:1; // 1 = переработчик } flags; int rapid; } unit_info; // структура, описывающая юнит typedef struct { int id; // юнита в таблице units int attack, shield, armory; // параметры юнита struct { int shield, armory; } max; } unit; // производит симуляцию одного юнита (против одного юнита) // возвращает истину если можно еще раз атаковать (скорострел) int attack_unit(const unit * attacker, unit * defender); // создает юнит скорректированный под параметры игрока unit create_unit(int id, int gattack, int gshield, int garmory); #endif ogamesim-20130107/csim/Changes0000664000000000000000000000035611056522513014504 0ustar rootroot1.17 * Added few languages (Polish, Chineze) 1.14 * Fix attack order for new unit; 1.13 * Added new unit; 1.12 * Fix units definition bug (deut=0 for Cruiser etc) 1.11 * Added Changes; * Splitted units.conf for more languages. ogamesim-20130107/csim/create_units.pl0000664000000000000000000001142410530373231016226 0ustar rootroot#!/usr/bin/perl use warnings; use strict; #==================================================================== # собственно сам генератор файлов #==================================================================== use Getopt::Long; select STDERR; $|=1; select STDOUT; my ($output_file, $header_file, $input_file); sub usage() { print < \$output_file, "h=s" => \$header_file, ) or usage; $input_file=shift @ARGV or usage; # если указан выходной файл то делаем его # вместо stdout if ($output_file) { open OUTPUT, ">", $output_file or die "Can not open '$output_file': $!"; select OUTPUT; } # читаем конфиг-файл open my $config, "<", $input_file or die "Can not open '$input_file': $!"; my @lines=grep /^\s*unit\d/, <$config>; close $config; s/\s+$//, s/^\s+//, s/#.*$// for @lines; my @units; # сюда складываем некоторые defines'ы для h-файла my @defines; for (my $uno=1; my @ulines=grep /^unit$uno\./, @lines; $uno++) { my %unit; for my $field (qw(name order structure shield attack capacity ground metal crystal deut large_chargo small_chargo recycler)) { ($unit{$field})=grep /^unit$uno\.$field/, @ulines and $unit{$field}=~s/^.*?=\s*//; defined $unit{$field} or $unit{$field}=0; } unless ($unit{metal}+$unit{crystal}==$unit{structure}) { print STDERR "'$unit{name}': error defined cost parameters\n", "\tmetal=$unit{metal}\n\tcrystal=$unit{crystal}\n\t", "deuterium=$unit{deut}\n\tstructere=$unit{structure}\n"; exit 10; } my @rapid; for (my $rno=1; my @rlines=grep /^unit$uno\.rapid$rno\./, @ulines; $rno++) { my ($rapin_unit)=grep /unit$uno\.rapid$rno\.name/, @rlines; my ($rapin_value)=grep /unit$uno\.rapid$rno\.value/, @rlines; $rapin_unit=~s/^.*?=\s*//; $rapin_value=~s/^.*?=\s*//; push @rapid, [ $rapin_unit => $rapin_value ]; } $unit{rapids}=\@rapid if @rapid; push @units, \%unit; } @units=sort { $a->{order} <=> $b->{order} } @units; print <{name}\" /* name */,\n"; for my $field(qw(shield structure attack capacity metal crystal deut)) { printf " %-8d /* %s */,\n", $_->{$field}, $field; } print " {\n"; for my $field (qw(ground large_chargo small_chargo recycler)) { printf " %-6d /* %s */,\n", $_->{$field}, $field; if ($field ne 'ground' and $_->{$field}) { my $name=$field; $name=~tr/a-z/A-Z/; push @defines, "#define $name $uno"; } } print " },\n"; if ($_->{rapids}) { printf " %-8d /* rapidno */\n", $rno; $rno++; $maxrapids=scalar @{$_->{rapids}} if $maxrapids < scalar @{$_->{rapids}}; } else { printf " %-8d /* rapidno */\n", 0; } print " },\n"; $uno++; } print "};\n\n"; my $units_count=scalar @units; $maxrapids++; print "/* Скорострелы */\n"; print "rapidfire rapids[$rno][$maxrapids]=\n{\n"; print " { { 0, 0, 0 }, },\n"; for my $unit (@units) { defined $unit->{rapids} or next; print "\n /* $unit->{name} */\n {\n"; for (@{$unit->{rapids}}) { my ($uname, $rapid)=@{$_}; my $uid=0; # определяем ID юнита против которого скорострел for ($uid=0; $uid{name} and last; } my $chance=0; # шанс = (1/e) в степени 1/скорострел $rapid and $chance=1-(1/$rapid); printf " { %2d, %5d, $chance },\n", $uid, $rapid; } print " },\n"; } print "};\n"; select STDOUT; if ($header_file) { open HEADER, ">", $header_file or die "Can not open '$header_file': $!"; select HEADER; } my $defines=join "\n", @defines; print < ] [ -o ] .SH DESCRIPTION .PP Tasks for simulation are consist of text files. .PP Example of task concluding all possible units is adduced bellow. .SH OPTIONS .B -i : task file (STDIN unless defined); .PP .B -o : result file (STDOUT unless defined); .PP .B -s : 1 <= value <= N (no limits); .PP .B -t : (seconds) 0 <= value <= N, 0=no limits; .PP .B -f : 0 <= value <= 100. .SH RETURN VALUES .B 0: if success .SH EXAMPLES Task concluding all possible units: .nf attacker attack = 9 shield = 10 armory = 11 Small Cargo = 10 Large Cargo = 10 Light Fighter = 20 Heavy Fighter = 30 Cruiser = 40 Battleship = 50 Colony Ship = 60 Recycler = 70 Espionage Probe = 80 Bomber = 900 Destroyer = 110 Deathstar = 120 defender attack = 11 shield = 12 armory = 13 Rocket Launcher = 100 Light Laser = 200 Heavy Laser = 300 Gauss Cannon = 400 Ion Cannon = 500 Plasma Turret = 600 Small Shield Dome = 1 Large Shield Dome = 1 Solar Satellite = 100 metal = 123456 crystal = 56789 deut = 987654 .fi ogamesim-20130107/csim/langs/0000775000000000000000000000000011056521651014313 5ustar rootrootogamesim-20130107/csim/langs/ca0000664000000000000000000000213310557720242014622 0ustar rootrootmetal.ca = Metall crystal.ca = Cristall deut.ca = Deuteri attack.ca = Tecnologi­a Militar shield.ca = Tecnologi­a de Defensa armory.ca = Tecnologi­a de Blindatje debris.loss.ca = Pérdides debris.max_loss.ca = Pérdides Màximes debris.min_loss.ca = Pérdides Mínimes debris.ca = Escombros debris.min.ca = Escombros (min) debris.max.ca = Escombros (max) attacker.ca = Atacant defender.ca = Defensor unit1.name.ca = Llançamissils unit2.name.ca = Canò Gauss unit3.name.ca = Estrela de la Mort unit4.name.ca = Colonitzador unit5.name.ca = Sonda d'espionatge unit6.name.ca = Canò Iònic unit7.name.ca = Caça Pesat unit8.name.ca = Reciclador unit9.name.ca = Bombarder unit10.name.ca = Làser Petit unit11.name.ca = Làser Gran unit12.name.ca = Nau petita de càrrega unit13.name.ca = Satel.lit Solar unit14.name.ca = Nau de Batalla unit15.name.ca = Creuer unit16.name.ca = Nau gran de càrrega unit17.name.ca = Caça Lleuger unit18.name.ca = Canò de Plasma unit19.name.ca = Cúpula gran de protecció unit20.name.ca = Destructor unit21.name.ca = Cúpula petita de protecció unit22.name.ca = Crucero de Batalla ogamesim-20130107/csim/langs/pl0000664000000000000000000000212411056521651014650 0ustar rootrootmetal.pl = Metal crystal.pl = Kryształ deut.pl = Deuter attack.pl = Technologia bojowa shield.pl = Technologia ochronna armory.pl = Opancerzenie debris.loss.pl=Straty debris.max_loss.pl=Maksymalne straty debris.min_loss.pl=Minimalne straty debris.pl=Szczątki debris.min.pl=Szczątki (min) debris.max.pl=Szczątki (maks) attacker.pl=Agresor defender.pl=Obrońca unit1.name.pl = Wyrzutnia rakiet unit2.name.pl = Działo Gaussa unit3.name.pl = Gwiazda Śmierci unit4.name.pl = Statek kolonizacyjny unit5.name.pl = Sonda szpiegowska unit6.name.pl = Działo jonowe unit7.name.pl = Ciężki myśliwiec unit8.name.pl = Recykler unit9.name.pl = Bombowiec unit10.name.pl = Lekkie działo laserowe unit11.name.pl = Ciężkie działo laserowe unit12.name.pl = Mały transporter unit13.name.pl = Satelita słoneczny unit14.name.pl = Okręt wojenny unit15.name.pl = Krążownik unit16.name.pl = Duży transporter unit17.name.pl = Lekki myśliwiec unit18.name.pl = Wyrzutnia plazmy unit19.name.pl = Duża powłoka ochronna unit20.name.pl = Niszczyciel unit21.name.pl = Mała powłoka ochronna unit22.name.pl = Pancernik ogamesim-20130107/csim/langs/cz0000664000000000000000000000240410702771470014655 0ustar rootroot# Replace 'LANG' into Your Language-ID (2-letters) # for ex.: metal.en, metal.ru etc # and replace text values AS OGAME text # and save result into file 'cz' (2-letters) # for ex.: en, ru, etc metal.cz = Kov crystal.cz = Krystaly deut.cz = Deuterium attack.cz = Zbraňové systémy shield.cz = Technologie štítů armory.cz = Pancéřování debris.loss.cz=Ztráty debris.max_loss.cz=Maximální ztráty debris.min_loss.cz=Minimání ztráty debris.cz=Trosky debris.min.cz=Trosky (min) debris.max.cz=Trosky (max) attacker.cz=Útočník defender.cz=Obránce unit1.name.cz = Raketomet unit2.name.cz = Gauss kanón unit3.name.cz = Hvězda smrti unit4.name.cz = Kolonizační loď unit5.name.cz = Špionážní sonda unit6.name.cz = Ion kanón unit7.name.cz = Těžký stíhač unit8.name.cz = Recyklátor unit9.name.cz = Bombardér unit10.name.cz = Lehký laser unit11.name.cz = Těžký laser unit12.name.cz = Malý transportér unit13.name.cz = Solární satelit unit14.name.cz = Bitevní loď unit15.name.cz = Křižník unit16.name.cz = Velký transportér unit17.name.cz = Lehký stíhač unit18.name.cz = Plasmová věž unit19.name.cz = Velký planetární štít unit20.name.cz = Destroyer unit21.name.cz = Málý planetární štít unit22.name.cz = Bitevní křižník ogamesim-20130107/csim/langs/ru0000664000000000000000000000304110557714647014700 0ustar rootrootmetal.ru = металла crystal.ru = кристалла deut.ru = дейтерия attack.ru = Оружейная технология shield.ru = Щитовая технология armory.ru = Броня космических кораблей debris.loss.ru=Потери debris.max_loss.ru=Максимальные потери debris.min_loss.ru=Минимальные потери debris.ru=Обломки debris.min.ru=Обломки (минимум) debris.max.ru=Обломки (максимум) attacker.ru=Атакующий defender.ru=Защитник unit1.name.ru = Ракетная установка unit2.name.ru = Пушка Гаусса unit3.name.ru = Звезда смерти unit4.name.ru = Колонизатор unit5.name.ru = Шпионский зонд unit6.name.ru = Ионное орудие unit7.name.ru = Тяжёлый истребитель unit8.name.ru = Переработчик unit9.name.ru = Бомбардировщик unit10.name.ru = Лёгкий лазер unit11.name.ru = Тяжёлый лазер unit12.name.ru = Малый транспорт unit13.name.ru = Солнечный спутник unit14.name.ru = Линкор unit15.name.ru = Крейсер unit16.name.ru = Большой транспорт unit17.name.ru = Лёгкий истребитель unit18.name.ru = Плазменное орудие unit19.name.ru = Большой щитовой купол unit20.name.ru = Уничтожитель unit21.name.ru = Малый щитовой купол unit22.name.ru = Линейный крейсер ogamesim-20130107/csim/langs/sp0000664000000000000000000000214110557720252014661 0ustar rootrootmetal.sp = Metal crystal.sp = Cristal deut.sp = Deuterio attack.sp = Tecnología Militar shield.sp = Tecnología de Defensa armory.sp = Tecnología de Blindaje debris.loss.sp=Pérdidas debris.max_loss.sp=Pérdidas máximas debris.min_loss.sp=Pérdidas mínimas debris.sp=Escombros debris.min.sp=Escombros (min) debris.max.sp=Escombros (max) attacker.sp=Atacante defender.sp=Defensor unit1.name.sp = Lanzamisiles unit2.name.sp = Cañón Gauss unit3.name.sp = Estrella de la Muerte unit4.name.sp = Colonizador unit5.name.sp = Sonda de espionaje unit6.name.sp = Cañón Iónico unit7.name.sp = Cazador Pesado unit8.name.sp = Reciclador unit9.name.sp = Bombardero unit10.name.sp = Láser Pequeño unit11.name.sp = Láser Grande unit12.name.sp = Nave pequeña de carga unit13.name.sp = Satélite Solar unit14.name.sp = Nave de Batalla unit15.name.sp = Crucero unit16.name.sp = Nave grande de carga unit17.name.sp = Cazador Ligero unit18.name.sp = Cañón de Plasma unit19.name.sp = Cúpula grande de protección unit20.name.sp = Destructor unit21.name.sp = Cúpula pequeña de protección unit22.name.sp = Crucero de Batalla ogamesim-20130107/csim/langs/en0000664000000000000000000000174710557714235014660 0ustar rootrootmetal.en = Metal crystal.en = Crystal deut.en = Deuterium attack.en = Weapons Technology shield.en = Shielding Technology armory.en = Armour Technology debris.loss.en=Losses debris.max_loss.en=Maximum losses debris.min_loss.en=Minimum losses debris.en=Debris debris.min.en=Debris (min) debris.max.en=Debris (max) attacker.en=Attacker defender.en=Defender unit1.name.en = Rocket Launcher unit2.name.en = Gauss Cannon unit3.name.en = Deathstar unit4.name.en = Colony Ship unit5.name.en = Espionage Probe unit6.name.en = Ion Cannon unit7.name.en = Heavy Fighter unit8.name.en = Recycler unit9.name.en = Bomber unit10.name.en = Light Laser unit11.name.en = Heavy Laser unit12.name.en = Small Cargo unit13.name.en = Solar Satellite unit14.name.en = Battleship unit15.name.en = Cruiser unit16.name.en = Large Cargo unit17.name.en = Light Fighter unit18.name.en = Plasma Turret unit19.name.en = Large Shield Dome unit20.name.en = Destroyer unit21.name.en = Small Shield Dome unit22.name.en = Battlecruiser ogamesim-20130107/csim/langs/de0000664000000000000000000000236610557716571014651 0ustar rootroot# Replace 'de' into You language-ID (2-letters) # for ex.: metal.en, metal.ru etc # and replace text values AS OGAME text # and save result into file 'lang' (2-letters) # for ex.: en, ru, etc metal.de = Metall crystal.de = Kristall deut.de = Deuterium attack.de = Waffentechnik shield.de = Schildtechnik armory.de = Raumschiffpanzerung debris.loss.de=Verluste debris.max_loss.de=Verluste (max) debris.min_loss.de=Verluste (min) debris.de=Trümmerfeld debris.min.de=Trümmerfeld (min) debris.max.de=Trümmerfeld (max) attacker.de=Angreifer defender.de=Verteidiger unit1.name.de = Raketenwerfer unit2.name.de = Gaußkanone unit3.name.de = Todesstern unit4.name.de = Kolonieschiff unit5.name.de = Spionagesonde unit6.name.de = Ionengeschütz unit7.name.de = Schwerer Jäger unit8.name.de = Recycler unit9.name.de = Bomber unit10.name.de = Leichtes Lasergeschütz unit11.name.de = Schweres Lasergeschütz unit12.name.de = Kleiner Transporter unit13.name.de = Solarsatellit unit14.name.de = Schlachtschiff unit15.name.de = Kreuzer unit16.name.de = Großer Transporter unit17.name.de = Leichter Jäger unit18.name.de = Plasmawerfer unit19.name.de = Große Schildkuppel unit20.name.de = Zerstörer unit21.name.de = Kleine Schildkuppel unit22.name.de = Schlachtkreuzer ogamesim-20130107/csim/langs/TEMPLATE_FOR_NEW_LANGS0000664000000000000000000000237010702771017017616 0ustar rootroot# Replace 'LANG' into You language-ID (2-letters) # for ex.: metal.en, metal.ru etc # and replace text values AS OGAME text # and save result into file 'lang' (2-letters) # for ex.: en, ru, etc metal.LANG = Metal crystal.LANG = Crystal deut.LANG = Deuterium attack.LANG = Weapons Technology shield.LANG = Shielding Technology armory.LANG = Armour Technology debris.loss.LANG=Losses debris.max_loss.LANG=Maximum losses debris.min_loss.LANG=Minimum losses debris.LANG=Debris debris.min.LANG=Debris (min) debris.max.LANG=Debris (max) attacker.LANG=Attacker defender.LANG=Defender unit1.name.LANG = Rocket Launcher unit2.name.LANG = Gauss Cannon unit3.name.LANG = Deathstar unit4.name.LANG = Colony Ship unit5.name.LANG = Espionage Probe unit6.name.LANG = Ion Cannon unit7.name.LANG = Heavy Fighter unit8.name.LANG = Recycler unit9.name.LANG = Bomber unit10.name.LANG = Light Laser unit11.name.LANG = Heavy Laser unit12.name.LANG = Small Cargo unit13.name.LANG = Solar Satellite unit14.name.LANG = Battleship unit15.name.LANG = Cruiser unit16.name.LANG = Large Cargo unit17.name.LANG = Light Fighter unit18.name.LANG = Plasma Turret unit19.name.LANG = Large Shield Dome unit20.name.LANG = Destroyer unit21.name.LANG = Small Shield Dome unit22.name.LANG = Battlecruiser ogamesim-20130107/csim/langs/cn0000664000000000000000000000174510734727100014644 0ustar rootrootmetal.cn = 金属 crystal.cn = 晶体 deut.cn = 重氢 attack.cn = 武器技术 shield.cn = 防御盾系统 armory.cn = 装甲技术 debris.loss.cn=损失 debris.max_loss.cn=最大损失 debris.min_loss.cn=最小损失 debris.cn=废墟 debris.min.cn=废墟 (最小) debris.max.cn=废墟 (最大) attacker.cn=进攻者 defender.cn=防守者 unit1.name.cn = 火箭发射装置 unit2.name.cn = 高斯炮 unit3.name.cn = 死星 unit4.name.cn = 殖民船 unit5.name.cn = 探测器 unit6.name.cn = 中子炮 unit7.name.cn = 重型战斗机 unit8.name.cn = 回收船 unit9.name.cn = 轰炸机 unit10.name.cn = 轻型激光炮 unit11.name.cn = 重型激光炮 unit12.name.cn = 小型运输舰 unit13.name.cn = 太阳能卫星 unit14.name.cn = 战列舰 unit15.name.cn = 巡洋舰 unit16.name.cn = 大型运输舰 unit17.name.cn = 轻型战斗机 unit18.name.cn = 等离子武器 unit19.name.cn = 大型防护罩 unit20.name.cn = 毁灭者 unit21.name.cn = 小型防护罩 unit22.name.cn = 战斗巡洋舰 ogamesim-20130107/csim/langs/fr0000664000000000000000000000251210557716266014662 0ustar rootroot# Replace 'LANG' into You language-ID (2-letters) # for ex.: metal.en, metal.ru etc # and replace text values AS OGAME text # and save result into file 'lang' (2-letters) # for ex.: en, ru, etc metal.fr = Métal crystal.fr = Cristal deut.fr = Deutérium attack.fr = Technologie Armes shield.fr = Technologie Bouclier armory.fr = Technologie Protection des vaisseaux spatiaux debris.loss.fr = pertes debris.max_loss.fr = Pertes maximales debris.min_loss.fr = Pertes minimales debris.fr = Débris debris.min.fr = Débris (min) debris.max.fr = Débris (max) attacker.fr = Attaquant defender.fr =Défenseur unit1.name.fr = Lanceur de missiles unit2.name.fr = Canon de Gauss unit3.name.fr = Étoile de la mort unit4.name.fr = Vaisseau de colonisation unit5.name.fr = Sonde espionnage unit6.name.fr = Artillerie à ions unit7.name.fr = Chasseur lourd unit8.name.fr = Recycleur unit9.name.fr = Bombardier unit10.name.fr = Artillerie laser légère unit11.name.fr = Artillerie laser lourde unit12.name.fr = Petit transporteur unit13.name.fr = Satellite solaire unit14.name.fr = Vaisseau de bataille unit15.name.fr = Croiseur unit16.name.fr = Grand transporteur unit17.name.fr = Chasseur léger unit18.name.fr = Lanceur de plasma unit19.name.fr = Grand bouclier unit20.name.fr = Destructeur unit21.name.fr = Petit bouclier unit22.name.fr = Battlecruiser ogamesim-20130107/csim/base_units.conf0000664000000000000000000001552310560073620016215 0ustar rootrootunit12.name = Small Cargo unit12.small_chargo = 1 unit12.order = 0 unit12.structure = 4000 unit12.shield = 10 unit12.attack = 5 unit12.capacity = 5000 unit12.rapid1.name = Solar Satellite unit12.rapid1.value = 5 unit12.rapid2.name = Espionage Probe unit12.rapid2.value = 5 unit12.metal=2000 unit12.crystal=2000 unit16.name = Large Cargo unit16.large_chargo = 1 unit16.order = 1 unit16.structure = 12000 unit16.shield = 25 unit16.attack = 5 unit16.capacity = 25000 unit16.rapid1.name = Solar Satellite unit16.rapid1.value = 5 unit16.rapid2.name = Espionage Probe unit16.rapid2.value = 5 unit16.metal=6000 unit16.crystal=6000 unit17.name = Light Fighter unit17.order = 2 unit17.structure = 4000 unit17.shield = 10 unit17.attack = 50 unit17.capacity = 50 unit17.rapid1.name = Solar Satellite unit17.rapid1.value = 5 unit17.rapid2.name = Espionage Probe unit17.rapid2.value = 5 unit17.metal=3000 unit17.crystal=1000 unit7.name = Heavy Fighter unit7.order = 3 unit7.structure = 10000 unit7.shield = 25 unit7.attack = 150 unit7.capacity = 100 unit7.rapid1.name = Solar Satellite unit7.rapid1.value = 5 unit7.rapid2.name = Espionage Probe unit7.rapid2.value = 5 unit7.rapid3.name = Small Cargo unit7.rapid3.value = 3 unit7.metal=6000 unit7.crystal=4000 unit15.name = Cruiser unit15.order = 4 unit15.structure = 27000 unit15.shield = 50 unit15.attack = 400 unit15.capacity = 800 unit15.rapid1.name = Solar Satellite unit15.rapid1.value = 5 unit15.rapid2.name = Rocket Launcher unit15.rapid2.value = 10 unit15.rapid3.name = Light Fighter unit15.rapid3.value = 6 unit15.rapid4.name = Espionage Probe unit15.rapid4.value = 5 unit15.metal=20000 unit15.crystal=7000 unit15.deut=2000 unit14.name = Battleship unit14.order = 5 unit14.structure = 60000 unit14.shield = 200 unit14.attack = 1000 unit14.capacity = 1500 unit14.rapid1.name = Solar Satellite unit14.rapid1.value = 5 unit14.rapid2.name = Espionage Probe unit14.rapid2.value = 5 unit14.metal=45000 unit14.crystal=15000 unit4.name = Colony Ship unit4.order = 6 unit4.structure = 30000 unit4.shield = 100 unit4.attack = 50 unit4.capacity = 7500 unit4.rapid1.name = Solar Satellite unit4.rapid1.value = 5 unit4.rapid2.name = Espionage Probe unit4.rapid2.value = 5 unit4.metal=10000 unit4.crystal=20000 unit4.deut=10000 unit8.name = Recycler unit8.order = 7 unit8.structure = 16000 unit8.shield = 10 unit8.attack = 1 unit8.capacity = 20000 unit8.rapid1.name = Solar Satellite unit8.rapid1.value = 5 unit8.rapid2.name = Espionage Probe unit8.rapid2.value = 5 unit8.metal=10000 unit8.crystal=6000 unit8.deut=2000 unit8.recycler = 1 unit5.name = Espionage Probe unit5.order = 8 unit5.structure = 1000 unit5.shield = 0.01 unit5.attack = 0.01 unit5.capacity = 0 unit5.crystal=1000 unit9.name = Bomber unit9.order = 9 unit9.structure = 75000 unit9.shield = 500 unit9.attack = 1000 unit9.capacity = 500 unit9.rapid1.name = Ion Cannon unit9.rapid1.value = 10 unit9.rapid2.name = Solar Satellite unit9.rapid2.value = 5 unit9.rapid3.name = Heavy Laser unit9.rapid3.value = 10 unit9.rapid4.name = Light Laser unit9.rapid4.value = 20 unit9.rapid5.name = Rocket Launcher unit9.rapid5.value = 20 unit9.rapid6.name = Espionage Probe unit9.rapid6.value = 5 unit9.metal=50000 unit9.crystal=25000 unit9.deut=15000 unit13.name = Solar Satellite unit13.order = 10 unit13.structure = 2000 unit13.shield = 1 unit13.attack = 1 unit13.crystal=2000 unit13.deut=500 unit20.name = Destroyer unit20.order = 11 unit20.structure = 110000 unit20.shield = 500 unit20.attack = 2000 unit20.capacity = 2000 unit20.rapid1.name = Solar Satellite unit20.rapid1.value = 5 unit20.rapid2.name = Light Laser unit20.rapid2.value = 10 unit20.rapid3.name = Espionage Probe unit20.rapid3.value = 5 unit20.rapid4.name = Battlecruiser unit20.rapid4.value = 2 unit20.metal=60000 unit20.crystal=50000 unit20.deut=15000 unit3.name = Deathstar unit3.order = 12 unit3.structure = 9000000 unit3.metal=5000000 unit3.crystal=4000000 unit3.deut=1000000 unit3.shield = 50000 unit3.attack = 200000 unit3.capacity = 1000000 unit3.rapid1.name = Gauss Cannon unit3.rapid1.value = 50 unit3.rapid2.name = Rocket Launcher unit3.rapid2.value = 200 unit3.rapid3.name = Colony Ship unit3.rapid3.value = 250 unit3.rapid4.name = Espionage Probe unit3.rapid4.value = 1250 unit3.rapid5.name = Ion Cannon unit3.rapid5.value = 100 unit3.rapid6.name = Heavy Fighter unit3.rapid6.value = 100 unit3.rapid7.name = Recycler unit3.rapid7.value = 250 unit3.rapid8.name = Bomber unit3.rapid8.value = 25 unit3.rapid9.name = Light Laser unit3.rapid9.value = 200 unit3.rapid10.name = Heavy Laser unit3.rapid10.value = 100 unit3.rapid11.name = Small Cargo unit3.rapid11.value = 250 unit3.rapid12.name = Solar Satellite unit3.rapid12.value = 1250 unit3.rapid13.name = Battleship unit3.rapid13.value = 30 unit3.rapid14.name = Cruiser unit3.rapid14.value = 33 unit3.rapid15.name = Large Cargo unit3.rapid15.value = 250 unit3.rapid16.name = Light Fighter unit3.rapid16.value = 200 unit3.rapid17.name = Destroyer unit3.rapid17.value = 5 unit3.rapid18.name = Battlecruiser unit3.rapid18.value = 15 unit22.name = Battlecruiser unit22.order = 13 unit22.structure = 70000 unit22.shield = 400 unit22.attack = 700 unit22.capacity = 750 unit22.metal=30000 unit22.crystal=40000 unit22.deut=15000 unit22.rapid1.name = Espionage Probe unit22.rapid1.value = 5 unit22.rapid2.name = Solar Satellite unit22.rapid2.value = 5 unit22.rapid3.name = Small Cargo unit22.rapid3.value = 3 unit22.rapid4.name = Large Cargo unit22.rapid4.value = 3 unit22.rapid5.name = Heavy Fighter unit22.rapid5.value = 4 unit22.rapid6.name = Cruiser unit22.rapid6.value = 4 unit22.rapid7.name = Battleship unit22.rapid7.value = 7 # ground units unit1.name = Rocket Launcher unit1.order = 14 unit1.structure = 2000 unit1.shield = 20 unit1.attack = 80 unit1.ground=1 unit1.metal=2000 unit10.name = Light Laser unit10.order = 15 unit10.structure = 2000 unit10.shield = 25 unit10.attack = 100 unit10.ground=1 unit10.metal=1500 unit10.crystal=500 unit11.name = Heavy Laser unit11.order = 16 unit11.structure = 8000 unit11.shield = 100 unit11.attack = 250 unit11.ground=1 unit11.metal=6000 unit11.crystal=2000 unit2.name = Gauss Cannon unit2.order = 17 unit2.structure = 35000 unit2.shield = 200 unit2.attack = 1100 unit2.ground=1 unit2.metal=20000 unit2.crystal=15000 unit2.deut=2000 unit6.name = Ion Cannon unit6.order = 18 unit6.structure = 8000 unit6.shield = 500 unit6.attack = 150 unit6.ground=1 unit6.metal=2000 unit6.crystal=6000 unit18.name = Plasma Turret unit18.order = 19 unit18.structure = 100000 unit18.shield = 300 unit18.attack = 3000 unit18.ground=1 unit18.metal=50000 unit18.crystal=50000 unit18.deut=30000 unit21.name = Small Shield Dome unit21.order = 20 unit21.structure = 20000 unit21.shield = 2000 unit21.attack = 1 unit21.ground=1 unit21.metal=10000 unit21.crystal=10000 unit19.name = Large Shield Dome unit19.order = 21 unit19.structure = 100000 unit19.shield = 10000 unit19.attack = 1 unit19.ground=1 unit19.metal=50000 unit19.crystal=50000 ogamesim-20130107/csim/parse_input.h0000664000000000000000000000162011056522520015704 0ustar rootroot/* Copyright (C) by Dmitry E. Oboukhov 2006, 2007 This package is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this package; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __PARSE__INPUT__H__ #define __PARSE__INPUT__H__ #include "units_info.h" #include "sim.h" sim_info * parse_input(int argc, char ** argv); #endif ogamesim-20130107/csim/units_info.h0000664000000000000000000000237011056522520015533 0ustar rootroot/* Copyright (C) by Dmitry E. Oboukhov 2006, 2007 This package is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this package; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __UNITS__INFO__H__ #define __UNITS__INFO__H__ #include "unit.h" /* Этот файл сгенерирован при помощи утилиты 'create_units.pl' поэтому менять его руками не стоит. При генерации данные взяты из файла 'units.conf' */ #define UNITS_COUNT 22 #define RAPIDS_COUNT (19-1) #define SMALL_CHARGO 0 #define LARGE_CHARGO 1 #define RECYCLER 7 extern unit_info units[22]; extern rapidfire rapids[13][19]; #endif ogamesim-20130107/csim/sim.h0000664000000000000000000001226511056522520014152 0ustar rootroot/* Copyright (C) by Dmitry E. Oboukhov 2006, 2007 This package is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this package; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __SIM__H__ #define __SIM__H__ #include #include "units_info.h" #define MAX_ROUNDS 6 // количество раундов в битве // нормализует ресурсы (делает их кратными 100) #define NORMALIZE_DEBRIS(__x) (((__x)/100)*100) // структура описывающая игрока typedef struct { int armory, // броня shield, // щиты attack, // атака unit[UNITS_COUNT], // юниты count; // общее число юнитов } gamer_info; // ресурсы typedef struct { int metal, crystal, deut; } resource; // структура описывающая задание для симулятора typedef struct { gamer_info attacker; // инфа о первом игроке gamer_info defender; // инфа о втором игроке int simulations; // количество симуляций time_t work_time; // время которое можно считать int forks_count; // количество параллельных процессов для расчета resource defender_resource; } sim_info; // ресурсы в потерях typedef struct { long long metal, crystal, deut, structure, total; } debris_resources; // потери typedef struct { debris_resources fleet, ground, all; } debris_info; // потери сведенные в одну структуру typedef struct { long long ldata_begin[0]; debris_info attacker, defender, both; struct { long long fleet, all; } recyclers; // переработчики long long ldata_end[0]; int idata_begin[0]; struct { int fleet, all; } moon; // шанс луны int idata_end[0]; } debris; // результат симуляции typedef struct { struct { int unit[UNITS_COUNT]; // по сколько юнитов выжило int count; // всего юнитов long long capacity; // вместимость } attacker, defender; debris debris; // общие потери int who_win; // кто выиграл int rounds; // количество раундов resource attacker_plunder; // сколько ресов забрал атакер struct { int small, large; } chargo; // сколько транспортов треба } sim_result, * psim_result; // результат многих симуляций typedef struct { int sim_count; // количество симуляций sim_info task; // начальное задание симуляции struct // { // среднее количество double unit[UNITS_COUNT]; // флотов и обломков long long capacity; // и средняя вместимость } attacker, defender; // // debris debris; // struct // { // int min, max; // double average; // } rounds; // количество раундов struct { int attacker, defender; } wins; // количество побед resource attacker_plunder; // среднее количество забранных ресов struct { int small, large; } chargo; // количество транспортов sim_result best_attacker, // лучшая симуляция для атакующего worst_attacker, // худшая симуляция для атакующего best_defender, // лучшая симуляция для защитника worst_defender, // худшая симуляция для защитника max_debris, // симуляция с максимальными обломками min_debris; // симуляция с минимальными обломками } sims_result; enum { NO_WIN, ATTACKER_WIN, DEFENDER_WIN }; sims_result * simulator(const sim_info * sim); #endif // __SIM__H__ ogamesim-20130107/csim/COPYING0000664000000000000000000004310310533560206014241 0ustar rootroot GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. ogamesim-20130107/csim/random.h0000664000000000000000000000163611056522520014642 0ustar rootroot/* Copyright (C) by Dmitry E. Oboukhov 2006, 2007 This package is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this package; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __RANDOM__H__ #define __RANDOM__H__ #ifdef __WIN32__ #define srandom(__x) srand((__x)) #define random() ((rand()&0x7FFF)|((rand()&0x7FFF)<<15)) #endif #endif ogamesim-20130107/csim/tests/0000775000000000000000000000000010541573377014363 5ustar rootrootogamesim-20130107/csim/tests/test1.txt0000664000000000000000000000006010541573377016160 0ustar rootrootattacker Cruiser = 20 defender Cruiser = 20 ogamesim-20130107/csim/tests/test2.txt0000664000000000000000000000055110471124667016162 0ustar rootrootattacker attack = 13 shield = 12 armory = 12 Light Fighter = 83000 Cruiser = 3000 Battleship = 2000 defender Small Cargo = 199 Large Cargo = 366 Light Fighter = 12323 Heavy Fighter = 25 Cruiser = 94 Battleship = 1483 Colony Ship = 1 Recycler = 306 Espionage Probe = 204 Bomber = 26 Destroyer = 8 attack = 12 shield = 12 armory = 12 ogamesim-20130107/csim/tests/test3.txt0000664000000000000000000000027610476270346016170 0ustar rootrootattacker attack = 13 shield = 13 armory = 13 Cruiser = 300 defender Light Fighter = 1770 attack = 12 shield = 10 armory = 11 metal = 1000000 crystal = 1000000 deut = 100000 ogamesim-20130107/csim/parse_input.c0000664000000000000000000002037511056522520015707 0ustar rootroot/* Copyright (C) by Dmitry E. Oboukhov 2006, 2007 This package is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this package; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include #include #include /* #include */ #include #include "unit.h" #include "units_info.h" #include "parse_input.h" #include "version.h" unit *attacker, *defender; #define BUF_SIZE 16384 //=================================================================== // читает входной поток данных //=================================================================== static void read_task(FILE * in, sim_info * sinfo) { // читаем весь ввод в буффер // (задача не может быть больше char *buffer=calloc(sizeof(char), BUF_SIZE); fread(buffer, BUF_SIZE, sizeof(char), in); sinfo->defender_resource.metal=0; sinfo->defender_resource.crystal=0; sinfo->defender_resource.deut=0; int i; // преобразуем все строки в Z-завершенные for (i=0; i=0; el--) { if(buffer[i+el]!=' ') break; buffer[i+el]=0; } // если вся строка удалилась то и хрен с ней if (*buffer==0) { i+=slen; continue; } // переключение контекста на атакующего if (strcasecmp(buffer+i, "attacker")==0) { what=0; } // переключение контекста на защитника else if (strcasecmp(buffer+i, "defender")==0) { what=1; } // строки вида key = value else { // выделяем ключ и значение char *key=buffer+i; char *value=strchr(key, '='); // если строка имеет правильный формат if (value) { // удаляем возможные пробелы в конце ключа for (el=value-key-1; el>=0; el--) { if(key[el]!=' ') break; buffer[i+el]=0; } // удаляем пробелы в начале значения *value++=0; while(*value==' ') value++; // значение должно быть целым, неотрицательным числом int ivalue=atoi(value); if (ivalue<0) { i+=slen; continue; } // атака игрока if (strcasecmp(key, "attack")==0) { gamer[what].attack=ivalue; } // щиты игрока else if (strcasecmp(key, "shield")==0) { gamer[what].shield=ivalue; } // броня игрока else if (strcasecmp(key, "armory")==0) { gamer[what].armory=ivalue; } else if (strcasecmp(key, "metal")==0) { sinfo->defender_resource.metal=ivalue; } else if (strcasecmp(key, "crystal")==0) { sinfo->defender_resource.crystal=ivalue; } else if (strcasecmp(key, "deut")==0) { sinfo->defender_resource.deut=ivalue; } // корабли игрока else { int uno; for (uno=0; unoattacker=gamer[0]; sinfo->defender=gamer[1]; } //=================================================================== // парсит входной поток (или читает указанный в аргументах файл) //=================================================================== sim_info * parse_input(int argc, char ** argv) { int c; char *file_input=0; char *file_output=0; sim_info *sim=calloc(sizeof(sim_info), 1); memset(sim, 0, sizeof(sim_info)); sim->simulations=100; sim->work_time=0; sim->forks_count=0; for (c=0; c!=-1; c=getopt(argc, argv, "i:o:s:ht:V" #ifndef __WIN32__ "f:" #endif )) { switch(c) { case 'V': printf("%s\n", VERSION); exit(0); case 'i': file_input=optarg; break; case 'o': file_output=optarg; break; case 't': sim->work_time=atoi(optarg); if (sim->work_time<0) { fprintf(stderr, "Illegal value for option -t: '%s'\n", optarg); sim->work_time=0; } break; #ifndef __WIN32__ case 'f': sim->forks_count=atoi(optarg); if (sim->work_time<0 || sim->work_time>100) { fprintf(stderr, "Illegal value for option -f: '%s'\n", optarg); sim->forks_count=0; } break; #endif case '?': case 'h': fprintf(stderr, "Usage: ./csim [ -i input_file ] [ -o output file ]\n" " [ -s iterations ] [ -t seconds work]\n" #ifndef __WIN32__ " [ -f forks_count ]\n" #endif " 1 <= iterations <= N (0 == 100 iterations)\n" " 0 <= seconds work <= N (0 == no limits)\n" #ifndef __WIN32__ " 0 <= forks_count <= 100\n" #endif " if input_file is not defined, use STDIN\n" " if output_file is not defined, use STDOUT\n" " if iterations is not defined, use 100 iterations\n" " -V - get version\n" ); exit(0); case 's': sim->simulations=atoi(optarg); if (!sim->simulations) { fprintf(stderr, "Illegal value for option -s: '%s'\n", optarg); exit(4); } break; } } // вывод в определенный файл if (file_output) { FILE *output=fopen(file_output, "wt"); if (!output) { fprintf(stderr, "Can not open file '%s': %s\n", file_output, strerror(errno)); exit(1); } dup2(fileno(output), fileno(stdout)); } printf( "GNU Ogame console simulator v" VERSION ", " "(cl) by Dmitry E. Oboukhov \n\n" "usage '%s -h' for help\n\n", argv[0]); // если файл определен в комстроке // то используем его вместо stdin if (file_input) { FILE * input=fopen(file_input, "rt"); if (!input) { fprintf(stderr, "Can not open file '%s': %s\n", file_input, strerror(errno)); exit(2); } read_task(input, sim); fclose(input); } else { read_task(stdin, sim); } return sim; } //===================================================================