/** * Copyright (c) 2006, 2007 * * Florian Schreier. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. The names of its contributors may never be used to endorse or promote * products derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * @author tomilo * @author waRhawK * @package trooptool * @subpackage rtwwmod */ =============================================================== T R O O P T O O L Road to World Wonder (RtWW) Mod ~ The right way to your final siege ~ • • • http://www.assembla.com/space/rtww/ =============================================================== [ About ] The inspiration of this mod comes while running the 4.0beta release from tomilo on welt1.travian.de in spring 2007. due to the late state of the world and the amount of sieges our ally needs to plan, we reached the limits of the tool quickly. We then tried to contact tomilo for a state on the 4.0-series and searched the community for other mods and tt-related projects, but in fact, we did not get anything that fit our needs. So we rolled up our sleeves and founded this mod. As many of the other mods available are more kind of quick hacks that just fit their founders needs, or are more private nature that were not designed for public usage, we decided to walk the general way... a new troop tool applicable for all the travian fans, startup allys, leading allys, huge ww meta rings, worldwonder builders, multiple season pro gamers and so on out there. Well driven by business level development and interaction with the community, we think our packages are welcome ;-) For details of what is planned further on this mod see the todo section or visit our project space at assembla.com --------------------------------------------------------------- [ Credits ] ~ Founder of the Troop Tool Base ~ tomilo ~ Mod Founding, -Concept & Main Engineering ~ waRhawK ~ Mod Engineering Support ~ Moonie73 zetor ~ Additional Ideas & Feature Delivery ~ Belse Serious ~ Translation ~ Belse Serious zetor Koen ~ Testers ~ Belse oLeav Serious Grzechu Pavel Kristoffer Moonie73 zetor ~ Thank you ~ Thanks to tomilo for the great job on the intial development starting at 1.0 to the 4.0beta! This mod won't exist without your graceful base release. However, we're worry about your absence for months in your official forums. What happened? We would be glad if you will get back on stage anytime! ;-) ~ Recruitment ~ You got good php/mysql skills? You have THE idea for our next release? You like to participate in testing, translation or any other way? Then join us on our space at assembla.com =============================================================== [ Change Log ] 2007/08/05 - 0.1 alpha 1 - non public based on: 4.0 beta (all) - cleaned up some syntax and added more phpDoc-comments (umkreis.php) - complete rewrite, changes: - helpers for the target (players->villages) - helpers for the arrival time - added arrival date for 24h+ raids - added meta raid type selector (off,def,...) - selectors for each troop type available (yes,no,optional) - prepared for troop strength calculation and limitation - better source selector (still supports old rights) - limits for field range and walk time - works on POST instead of GET - overall cleanup and more efficient code (umkreis2.php) - complete rewrite, changes: - security: can be invoked from umkreis.php only - universal unit:race mapping for all the different types - new walktime calculation with full tournament place support - more detailed unit and unit type processing - more detailed output: - show number of squads available - playername with profile and contact link - coordinaates with re-route information and village names - distance in fields - start time with start date - overall cleanup and more efficient code (config.php) - added new constants for: - the active language (no further file replacements needed) - general mod support and mod characteristics (function.php) - new html head for pages and forwards - new function sortarrow() for general usage on all list column headers (inc_config.php) - added/modified constants for: - the page title - an intro text displayed on the top - a second line for the intro text - a logo to be shown in the top left corer - the ally code (shortcut) - the ally name (lang_de.php) - renamed from lang.php to avoid replacements on switchting languages (menu.php) - removed link to userconfig.php because it is not yet usable (oben.php) - rewrite, now displays logo, title, two-lined intro text and a general about message for the current instance (style.css) - overall more stable look'n'feel, shrinked some sizes, slightly recoloring and a few graphics (userconfig.php) - disabled by die() as not yet usable (img/) - added default logo for top left corner and main background --------------------------------------------------------------- 2007/09/02 - 0.1 beta 1 - non public based on: 4.0 beta (common) - added head phpDoc to all files - shifted all session access to new unique instance key introduced in this version to allow proper parallel usage - better utf-8 processing on several areas; tested with german umlauts (database) - don't forget to add your configured table prefix - ALTER TABLE `hero` ADD `active` TINYINT( 1 ) UNSIGNED NULL DEFAULT NULL AFTER `sid` ; - ALTER TABLE `dorf` ADD `type` TINYINT( 1 ) UNSIGNED NULL DEFAULT NULL AFTER `name` ; - ALTER TABLE `dorf` ADD `layout` TINYINT( 1 ) UNSIGNED NULL DEFAULT NULL AFTER `type` ; - ALTER TABLE `dorf` ADD `size` SMALLINT(4) UNSIGNED NULL DEFAULT NULL AFTER `layout` ; - ALTER TABLE `spieler` ADD `lasthost` CHAR( 15 ) NULL DEFAULT NULL ; (install.php) - translated to english - now writes the new constants into inc_config.php - added generation/saving of unique instance key - added language selection - creates the new 'active' field in 'hero' table - creates the new 'type', 'layout' and 'size' fields in 'dorf' table - creates the new 'lasthost' field in 'spieler' table (modnotes.txt) - file added (img/) - added icons for resources (res[1-5].gif) - added activity bullets (b[1-5].gif) - added external.gif - added clock.gif - replaced del.gif - optimized transparency on some icons (umkreis2.php) - finalized tournament square calculation and checked all unit walk times... awesome accuracy! differences between game and this tool... 0.0 seconds ;-) - fixed some minor bugs in result list (eg. wrong coordinaates) - made all rows dual-lined and reorganized some things to increase usability - fixed major bug in missing results when force one or more unit type or desired unit types are not available per tribe - moved function zerofill() to functions.php - removed depreated code from 4.0base release - added new size, type and layout information on target village display (function.php) - optimized fwd() function with full top layer display and additional message to display, also has now different delays for empty and message'd forwards - enhanced security() function with better user interaction, more precisioned session checks and session timeout handling (hardcoded to 3 hrs atm) - optimized write_header() function with optimized output and now always includes the overlib by default - added display of hero image if troop type greater 10 given in img_pfad() function - moved into function zerofill() from umkreis2.php (index.php) - session timeout initialization and forwarding with personalized message on successful login - enhanced security: merged error messages for wrong username and password to bust leechers from gathering usernames - enhanced security: check name/password first, then display locked account message (was between) - update the new 'lasthost' field for the user on login (lang_de.php) - added generic error messages - integrated some left hardcoded things from 0.1a1 (lang_en.php) - file added (heavy thx to Belse!) - synchronized with latest changes made on lang_de.php (config.php) - include language file based on new constant (user.php) - replaced own static header by making use of write_header() function - added sorting of ascending source village and as secondary, location village, name - visual enhancements related to the rewrite of umkreis.php - added displayment of active hero on his current location and also quick-linked to hero page in edit mode (hero.php) - replaced own static header by making use of write_header() function - visual enhancements related to the rewrite of umkreis.php - added toggle function to mark the active hero; indicated by the well-known activity bullets (dorf.php / senddorf.php) - replaced own static header by making use of write_header() function - visual enhancements related to the rewrite of umkreis.php - added processing of village type, layout and size - added bulletpoins for village type indication (not yet that "ultimate" solution) (admin.php) - moved last update column from right to left and indicate age by recently added activity bullet symbols - repaint units on the sum for somehow better usability on huge amount of members (members.php) - visual enhancements related to the rewrite of umkreis.php - added rollover statistic for each player like on admin.php, if access allowed - added link to showtroops.php for each player if access allowed - removed rollover menus for rights management for players that don't have such privilueges (stats.php / image.php) - fixed bug statistics not shown from players that contain non ascii-characters - fixed bug that ally statistic not shown (thx to (profile.php) - disabled at all; need some rewrite here (register.php) - visual enhancements related to the rewrite of umkreis.php - fills the new 'lasthost' field for the user on registration --------------------------------------------------------------- 2007/09/22 - 0.1 beta 2 - non public based on: 4.0 beta (all) - removed propietary utf-8 handling from all files except that ones that print out (non-utf-8-) constants. - unified usage of write_header() function. - added proper encoding of submitted form data by adding tag [accept-charset="utf-8"] to all forms. (database) - optimized character sets and their collactions. see [update/update_from_rtww_0.1b1.sql] for details. (.htaccess) - defines php.ini directives for string extension that is required for proper utf-8 usage. if your php natively was configured using string with utf-8 and full function overload, or if your server does not support string, delete this file. but be aware that without string function overload, the tool will defenitively *NOT* support all non-ascii characters. (umkreis2.php) - fixed strftime PHP Warning in result table header due to wrong encapsulation (user.php) - fixed "auto/manual" switch not working in FF due to wrong case sensitivity used in DOM id's - fixed "jumping tbody" problem in FF while defining a tbody's visibility as "block" - released the coordinates fields for edit when updating troops (good when made a mistake - thx to Grzechu) (senddorf.php) - fixed bug that always stores residence value even if palace was selected in village form (install/) - directory added that contain future installation and migration files both for 3.x and 4.x base versions. be sure it is removed from the server after proper installation/migration. (install.php) - fixed bug that did not store ALLY NAME and ALLY CODE to the created inc_config.php. - more safe form data processing. - removed internal sql and now creates database structure from templated "install.sql" file (added this release). It also adds some example data assigned to the admin user now. - moved to "install/" directory. (stat.php) - added image titles and removed some whitespace (img/font.ttf) - added free unicode-font "FreeSans" (GPL) for diagram rendering. Source: http://download.savannah.gnu.org/releases/freefont/ (img/image.png, img/diagramm.php) - did some repaint (image.php) - slightly optimized layout and making use of the new font (diagramm.php) - slightly optimized layout and display of percentage and sum --------------------------------------------------------------- 2007/11/15 - 0.1 final - release candidate - private based on: 4.0 beta (all) - replaced calls of string functions to all string equivalents. (.htaccess) - disarmed the string.function_overload directive and moved all other php_value directives into the config.php. this setup will be more webspace-friendly as php_value-directives at most are simply disallowed. (lang_de.php) - converted to native utf-8 files and replaced all html entities by their native utf-8 equivalent. (admin.php) - fixed bug that inactive heros were shown up. (hero.php, heroInsert.php) - added option to toggle active/inactive state within the edit form. - 'name' and 'type' fields are now editable while modifying an existing hero. (showtroops.php) - now also shows the players' villages. (lang_it.php) - added italian translation. (lang_se.php) - added swedish translation. (send.php) - auto-use position village as production village if leaved empty. - new regex-parser. still needs some tweaks but working fine now for "OWN TROOPS" on all browsers. - auto-update statistics after save. - disabled the auto-creation feature for non-existent villages. (install/install.php) - create database structure after writing the config file. - added option for italian and swedish languages. - added some hints for all the fields to avoid some people get confused what to enter each. (member.php, deletedorf.php) - added recursive delete to avoid database is being wasted by dead relations. - fixed bug that overlib was included twice (member.php). (image.php) - added check for freetype support and fallback to simple string rendering if not. (overlib/) - moved into new scripts/ folder. (scripts/datepicker.php) - added datepicker javascript wrapped by php for localized strings. (umkreis.php) - added option to disable arrival timing at all for just gathering walktime durations. - rewrite of and enabled all time incrementors. - implemented new JS calendar for picking up an arrival date. - allowed for localized date format in field order using new language specs. (umkreis2.php) - skip overall arrival time processing if just walktime durations are configured. - allowed for localized date format using new language specs. (user.php) - fixed bug that hero was shown more than once. (config.php) - changed inclusion order. - fixed forward to install.php when calling the directory root on new installations. --------------------------------------------------------------- 2007/12/14 - 0.1 final - public based on: 4.0 beta (all) - unified the format of all phpdoc @since tags (install.php) - added chmod 777 to the fresh created inc_config.php to solve some manual access problems on certain environments. - added option for dutch language selection. (lang_ne.php) - dutch translation added. (user.php) - rewrite troop queries using joins to fix bug that troops were not shown if corresponding villages missing. - indicate missing villages by display 'unknown' as name relacement. - quick performance improvement: delcared config query result static to avoid querying the same for each village name. - moved out function print_villagename() to function.php (function.php) - moved in function print_villagename() from user.php, rename to format_village() and added doc block. (showtroops.php) - dropped hardcoded site title out of the write_header() call. - rewrite sql using joins to fix bug that troops were not shown if corresponding villages missing. - synchronized appeareance with the list from user.php, use format_village() for village name display. - synchronized hero appeareance with the list from hero.php, including the new active state. - fixed too large colspan in village table head section. (image.php) - fixed bug that font file may not be accessed properly. --------------------------------------------------------------- 2008/01/09 - 0.1.1 - public based on: 4.0 beta 2008/01/01 by waRhawK - fixed untracked bug in heroInsert.php that caused floating point bonus values to be cutted to their integer representative or raise an sql error, depending on the format given by the user. - fixed untracked bug in function.php::zero() that caused floating point numbers smaller than 1.0 got greyed out as zeroes. 2008/01/09 by waRhawK - fixed wrong label - duplicate "umkreis_distance" - in lang_de.php, other languages not affected. - fixed wrong colspan count in umkreis2.php when viewing results without arrival time. =============================================================== [ Todo's ] (general) - support for multiple worlds in one instance including world specs setup (eg. to support speed) - support for multiple allys. they may still play alone (then TT becomes hosting character) or can share their groups with others (megas, rings, BND's...) - support for grouping of players within a chain of allys including rights for each the groups (eg. group leaders). eg. this will be graceful for all allys using squads. - enhanced rights management and security for all existing features and new ones, of course - more user-friendly interface, wizards, images, AJAX-helpers and quickselects, auto-completion and auto-parsers... - full utf-8 environment including an xml-based language layer for native worldwide language support as well as new translations. - auto-update script that checks for new versions on a master host by using a webservice. - auto-fetch the travian SQL and sync available information with all trooptool internals (villages, ...) - support for entering gathered information from scouts on foreign/enemy villages that will be shown while planning sieges against - support for switching world states (new opened, registration stop, worldwonder appearance, ...) - worldwonder and artefact management including treasure chambers on villages, etc. - drop german hardcoded things like comments, filenames and database tables/fields, everything of that should be in english only. - more phpDoc compatibiliy and doxygen generation somewhere (eg. if we got a master host) - evaluate PHP4/5 and MySQL 4/5 compatibility and officially map the requirements to each package. - include a map generator/builder, reserve fields for players and create plans for settlers or nobilities on them - include an attack result parser and store its results internally to be re-used on map, siege planner, etc. - send registration mails to the admin, clearance mails to the players... - "cron" that checks integrity, eg. for warning mails to players on absence or ghost accounts that already leaved game or ally (needs travian SQL sync) - wrapping support to include an instance in other platforms (eg. phpBB) - maybe some alternative user layers to inbound account databases from community environments (phpBB, vbb, ...) - better session handling / timeout escalation. (database) - more indicies and more efficient column setup - add system flags for create/update/delete on each row - inherit all depencies on deletion, eg. for now we have a bug that causes "ghost villages" that garble village and troop setup once a new player got it at a later time. (install.php) - perform an environment check before performing actions, also support updates for existing installations. => rewrite? (umkreisx.php) - finalize grayed features on the form including heroes, army strength calculations, time and date pickups (calendar), ... - support for selecting squad results to filter the final results for saving and revoking plans. - support chain planning by saving a final result and start another run while troops from first plans will be reserved. - create an umkreis3.php that generates textual orders for all affected players after chain planning to be copy+pasted as IGM's or on ally forums... - include some time buffers for intial and re-route reaction for the players to follow properly - store latest form fillments in a cookie or session ;) (admin.php) - Support for sorting on each column (yes, units as well) - Support for grouping results once multiple world, ally and player groups are implemented - more popup information on units (member.php) - enhanced rights management - more user information and quick statistics (village count, ranking, join date, last login date...) - Assignment to worlds, allys and groups once implemented including new rights and sort-/groupable new lists. (user.php) - more user-friendly interface like quick selects for villages and finalize the auto-parser - add some more display dynamics (sorting...) - more fancy info on all troops and some sum calculations (hero.php) - add vitality and experience fields - calculation of proper skillment and next skill raise suggestions - kill calculator to reach the next level - show top and flop heroes within a world, a list of all heroes, etc. - free experience announcement/management on dead players, lost villages or scouted advantages. - add some statistics for hero growth - add fast increase/decrease buttons on each the skills like ingame instead of filling in the skill results - hero test builder... grab a unit and skill it for free including a analysis (dorf.php) - auto-sync with travian SQL (then players just need to fullfill the additional information, not the villages itsself) - add village layout (eg. 4-4-4-4, 1-1-1-15, ...). use images from graphics pack in a layer selection - add more buildings and res production values - add residential info (comes with SQL?) - add fast increase/decrease buttons on each the building levels - monitor residential info on all villages and perhaps create some growth statistics based on that like the one for the troops - support for some kind of village role (farm, off/def production, off/def storage, WW, artefact holder, etc.) (stat.php) - more sections of statistics including realtime calculations on worlds, allys, squads, unit amount, top off/def player, top hero, top village and so on.... (profil.php) - more community-like, non game-relavant infos about the players. - some integrity checks on troop rules, notes by squad leaders or admins, etc. - sitting management - absence/holiday management including escalations... - support for multiple players on one account (dual-play...) - support for profiling the online times per player to quickly find peaks and leaks to ensure optimum sitting and dual-play assignments - support for game leaving options and announcements, eg. release villages or full account (PW) for others (faq.php) - replace more to come... =============================================================== EOF