From: <baz...@us...> - 2008-02-08 13:48:03
|
Revision: 7802 http://armagetronad.svn.sourceforge.net/armagetronad/?rev=7802&view=rev Author: bazaarmagetron Date: 2008-02-08 05:48:03 -0800 (Fri, 08 Feb 2008) Log Message: ----------- Fixed compilation on non-armathentication builds. Modified Paths: -------------- armagetronad/branches/0.2.8/armagetronad/src/engine/ePlayer.cpp armagetronad/branches/0.2.8/armagetronad/src/engine/ePlayer.h Added Paths: ----------- armagetronad/branches/0.2.8/armagetronad/ Removed Paths: ------------- armagetronad/branches/0.2.8/armagetronad/ Copied: armagetronad/branches/0.2.8/armagetronad (from rev 7800, armagetronad/branches/0.2.8/armagetronad) Property changes on: armagetronad/branches/0.2.8/armagetronad ___________________________________________________________________ Name: bzr:revision-info + timestamp: 2008-02-08 14:38:45.589999914 +0100 committer: Manuel Mooos <z-...@us...> properties: branch-nick: 0.2.8-armagetronad-work Name: bzr:file-ids + Name: bzr:revision-id:v3-list-QlpoOTFBWSZTWZvbKhsAAAdRgAAQABK6798QIABURMgAAaeoNT1TxT1DQbKaeobXKiyAmlWT7Y5MkdJOtXDtB7w7DOGFBHiOBxaUIu7HQyyQSvxdyRThQkJvbKhs + 538 z-...@us...-20080207163247-91eo4mrbiind6xrz 540 z-...@us...-20080208122252-nvhak6io6j0ui3aa 541 z-...@us...-20080208123045-76r9p0l7iwpbq1hy 542 z-...@us...-20080208124439-10s870zpb61b8buo 543 z-...@us...-20080208133845-a22a5j0z6vjgfaby Name: svn:ignore + config.sub install-sh Eclipse* configure version.h CVS doc_bak log leak.history config.cache config.log .gdbinit config.h Makefile leak.log diff scorelog.txt ladder.txt highscores.txt config.status won_matches.txt mainicon.ico .dont_update screenshot_1.bmp won_rounds.txt Makefile.global memprofile* frommaster.srv screenshot* ml astat master bindist master_list.srv big_brother master.srv *.dll *.ilk README.txt README-SDL.txt update.bat tagcvs .infiles autom4te.cache config.h.stamp Testme html.m4 var ded .beautytag* config.h.in aclocal.m4 ChangeLog INSTALL Makefile.in missing COPYING version depcomp .version.new .cvsfiles stamp-h1 touch universal_variable_substitutions universal_variable_values.in universal_variables extrapaths universal_variable_values_makefile macosx_build_information.yml Modified: armagetronad/branches/0.2.8/armagetronad/src/engine/ePlayer.cpp =================================================================== --- armagetronad/branches/0.2.8/armagetronad/src/engine/ePlayer.cpp 2008-02-08 12:52:15 UTC (rev 7800) +++ armagetronad/branches/0.2.8/armagetronad/src/engine/ePlayer.cpp 2008-02-08 13:48:03 UTC (rev 7802) @@ -2789,7 +2789,7 @@ { // player username comes from authentication name and may be much different from // the screen name - tos << se_EscapeName( p2->GetRawAuthenticatedName() ) << " ( " << p2->GetName() << ", " + tos << p2->GetFilteredAuthenticatedName() << " ( " << p2->GetName() << ", " << tCurrentAccessLevel::GetName( p2->GetAccessLevel() ) << " )"; } @@ -4071,7 +4071,7 @@ if ( alias != "" ) { rawAuthenticatedName_ = alias; - newAuthenticatedName = se_EscapeName( rawAuthenticatedName_ ).c_str(); + newAuthenticatedName = GetFilteredAuthenticatedName(); // elevate access level again according to the new alias se_CheckAccessLevel( accessLevel_, newAuthenticatedName ); @@ -4125,11 +4125,11 @@ { if ( admin ) { - se_SecretConsoleOut( tOutput( "$logout_message_deop", GetName(), se_EscapeName( rawAuthenticatedName_ ).c_str(), admin->GetLogName() ), this, admin ); + se_SecretConsoleOut( tOutput( "$logout_message_deop", GetName(), GetFilteredAuthenticatedName(), admin->GetLogName() ), this, admin ); } else { - se_SecretConsoleOut( tOutput( "$logout_message", GetName(), se_EscapeName( rawAuthenticatedName_ ).c_str() ), this ); + se_SecretConsoleOut( tOutput( "$logout_message", GetName(), GetFilteredAuthenticatedName() ), this ); } } @@ -6410,7 +6410,7 @@ // take the user name to be the authenticated name if ( IsAuthenticated() ) { - userName_ = se_EscapeName( rawAuthenticatedName_ ).c_str(); + userName_ = GetFilteredAuthenticatedName(); if ( se_legacyLogNames ) { userName_ = tString( "0:" ) + userName_; @@ -6622,6 +6622,25 @@ return *this; } +// ****************************************************************************************** +// * +// * GetFilteredAuthenticatedName +// * +// ****************************************************************************************** +//! +//! @return The filtered authentication name, or "" if no authentication is supported or the player is not authenticated +//! +// ****************************************************************************************** + +tString ePlayerNetID::GetFilteredAuthenticatedName( void ) const +{ +#ifdef KRAWALL_SERVER + return se_EscapeName( GetRawAuthenticatedName() ).c_str(); +#else + return tString(""); +#endif +} + // allow enemies from the same IP? static bool se_allowEnemiesSameIP = false; static tSettingItem< bool > se_allowEnemiesSameIPConf( "ALLOW_ENEMIES_SAME_IP", se_allowEnemiesSameIP ); Modified: armagetronad/branches/0.2.8/armagetronad/src/engine/ePlayer.h =================================================================== --- armagetronad/branches/0.2.8/armagetronad/src/engine/ePlayer.h 2008-02-08 12:52:15 UTC (rev 7800) +++ armagetronad/branches/0.2.8/armagetronad/src/engine/ePlayer.h 2008-02-08 13:48:03 UTC (rev 7802) @@ -373,6 +373,7 @@ inline ePlayerNetID const & GetUserName( tString & userName ) const; //!< Gets this player's name, cleared for system logs. Use for writing to files or comparing with admin input. tString const & GetLogName( void ) const{ return GetUserName(); } //!< Gets this player's name, cleared for system logs (with escaped special characters). Use for writing to files. + tString GetFilteredAuthenticatedName( void ) const; //!< Gets the filtered, ecaped authentication name #ifdef KRAWALL_SERVER tString const & GetRawAuthenticatedName( void ) const{ return rawAuthenticatedName_; } //!< Gets the raw, unescaped authentication name void SetRawAuthenticatedName( tString const & name ){ if ( !IsAuthenticated()) rawAuthenticatedName_ = name; } //!< Sets the raw, unescaped authentication name This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <baz...@us...> - 2008-04-19 18:46:44
|
Revision: 8417 http://armagetronad.svn.sourceforge.net/armagetronad/?rev=8417&view=rev Author: bazaarmagetron Date: 2008-04-19 11:46:18 -0700 (Sat, 19 Apr 2008) Log Message: ----------- wrtlprnft: Added settings to separately enable/disable all ladderlog outputs. Currently all are enabled by default, but this may change for further additions. Modified Paths: -------------- armagetronad/branches/0.2.8/armagetronad/NEWS armagetronad/branches/0.2.8/armagetronad/language/english_base.txt armagetronad/branches/0.2.8/armagetronad/src/engine/ePlayer.cpp armagetronad/branches/0.2.8/armagetronad/src/engine/ePlayer.h armagetronad/branches/0.2.8/armagetronad/src/engine/eTeam.cpp armagetronad/branches/0.2.8/armagetronad/src/tron/gCycle.cpp armagetronad/branches/0.2.8/armagetronad/src/tron/gGame.cpp armagetronad/branches/0.2.8/armagetronad/src/tron/gWinZone.cpp Added Paths: ----------- armagetronad/branches/0.2.8/armagetronad/ Removed Paths: ------------- armagetronad/branches/0.2.8/armagetronad/ Copied: armagetronad/branches/0.2.8/armagetronad (from rev 8413, armagetronad/branches/0.2.8/armagetronad) Property changes on: armagetronad/branches/0.2.8/armagetronad ___________________________________________________________________ Name: bzr:revision-info + timestamp: 2008-04-19 20:17:52.466000080 +0200 committer: wrtlprnft <wrt...@us...> properties: branch-nick: 0.2.8 Name: bzr:ancestry:v3-list-QlpoOTFBWSZTWZvbKhsAAAdRgAAQABK6798QIABURMgAAaeoNT1TxT1DQbKaeobXKiyAmlWT7Y5MkdJOtXDtB7w7DOGFBHiOBxaUIu7HQyyQSvxdyRThQkJvbKhs + z-...@us...-20080208133752-2gw99n7wzsq0ltfk wrt...@us...-20080212214934-v54mfu759ziymru7 z-...@us...-20080214125233-8hc05ipgtpm53z2y z-...@us...-20080218102004-k7o07blcekpsy6pi epsy-20080318191455-5ote91wclfg68qdy z-...@us...-20080318193704-gtnd68g3kjoquken z-...@us...-20080318200922-e17yjjvbwsktis36 epsy-20080319185658-etcxfg4wz00xazo0 z-...@us...-20080319200200-f26b4cmyob009jkx epsy-20080408171021-bdfdnf7eebr1j84o Name: bzr:file-ids + Name: bzr:revision-id:v3-list-QlpoOTFBWSZTWZvbKhsAAAdRgAAQABK6798QIABURMgAAaeoNT1TxT1DQbKaeobXKiyAmlWT7Y5MkdJOtXDtB7w7DOGFBHiOBxaUIu7HQyyQSvxdyRThQkJvbKhs + 538 z-...@us...-20080207163247-91eo4mrbiind6xrz 540 z-...@us...-20080208122252-nvhak6io6j0ui3aa 541 z-...@us...-20080208123045-76r9p0l7iwpbq1hy 542 z-...@us...-20080208124439-10s870zpb61b8buo 543 z-...@us...-20080208133845-a22a5j0z6vjgfaby 544 z-...@us...-20080208134134-bxi2z09linxnzl63 545 z-...@us...-20080208165812-xabnqfq34666e2z5 546 z-...@us...-20080208170201-jmubp7bm7lrpmw4z 551 z-...@us...-20080209115751-1w0yo2lwtv1xxmsc 552 z-...@us...-20080209121700-8mf9ure4bfaxtqfp 553 z-...@us...-20080209130301-0kw4jxjm7cvmbptp 561 z-...@us...-20080210002729-ee7t2nfh542nxksj 563 wrt...@us...-20080210153610-ucwvl013f1yil7og 564 z-...@us...-20080210212253-bxpkh4mtyisctr39 565 z-...@us...-20080211084800-j2c13scyxqc31m8x 566 z-...@us...-20080211092807-gx4kehlz96356bpc 567 z-...@us...-20080211093118-7l2xf6tr891yx5ap 568 z-...@us...-20080211105013-2k81i8bnj2k4hhoy 569 z-...@us...-20080211112608-8qx1tlf94iwrrt1l 570 z-...@us...-20080211140216-bdm3bpx8zkv5z3se 571 z-...@us...-20080211151812-grth0h6loq9xxd3o 572 z-...@us...-20080211151834-b3vk44tzyhtm744f 573 z-...@us...-20080211152418-o4a4kj326igqh1k8 574 z-...@us...-20080211154253-1etqludquvn7co8g 575 z-...@us...-20080211160428-8ilc9qovrarz8w62 576 z-...@us...-20080211193858-at0c5em1d3lm8nbe 577 z-...@us...-20080211200418-qdmnetojj8pme9xy 578 z-...@us...-20080211200716-e44opbnzxkha3c75 579 z-...@us...-20080211200826-m9ogo5duturpmsmt 580 wrt...@us...-20080211221232-nqw6a4oxgj4ntika 581 z-...@us...-20080211232908-79iedh9xr87l8yta 582 z-...@us...-20080211232937-iolwhcxmqa1njxcb 583 z-...@us...-20080211233009-zdmtdhf1vg9bdbqt 584 z-...@us...-20080211233052-bzwl4p5d9kmxqrez 585 z-...@us...-20080211235937-6r1abzr9i24hi28j 586 z-...@us...-20080212001854-jy3lv5lpiti2am0i 587 z-...@us...-20080212004511-1guj58f0ll5o4g2u 588 z-...@us...-20080212004523-d30hcrujanooulp6 589 z-...@us...-20080212013442-k2dt1qg06vpm0riz 590 z-...@us...-20080212111458-w1vg4vbqmsxs0apt 591 z-...@us...-20080212111803-hlydu4wbw7upc32b 592 z-...@us...-20080212113358-rittno0wqzk5oh2c 593 z-...@us...-20080212115640-h8bs2cwm75tqmgt8 594 z-...@us...-20080212123800-5r9ttplpbdw88m2q 595 z-...@us...-20080212125109-t8afy73nty55ih47 596 z-...@us...-20080212135138-mevw0j5m97vchlgo 597 z-...@us...-20080212141438-2yz5c9esxrswak61 598 z-...@us...-20080212141535-vtic2yccgieyn7v0 599 z-...@us...-20080212143704-jd8pg0cnuh0kwab5 600 z-...@us...-20080212154606-ppxy7dl99fk8xk6j 601 z-...@us...-20080212154658-z5x6zuir7bxoq48i 602 z-...@us...-20080212212236-9803ovcxrzfzqf40 603 z-...@us...-20080212214530-sqlc3x9wk3b36169 604 z-...@us...-20080212215644-d36an0w0zdlipf03 605 z-...@us...-20080212224923-7d3wi96op47p4zyt 606 z-...@us...-20080212235107-l67eu41fhlpy0jkp 607 z-...@us...-20080213005523-2qet70xfnd34ool9 608 z-...@us...-20080213005609-16omuuhsf5svvtnf 609 z-...@us...-20080213091828-7k5xdbmhgvqacwfk 610 z-...@us...-20080213120826-83e9b69ps9gpncqm 611 z-...@us...-20080213141821-4av1kc6gjlpqxb9k 612 z-...@us...-20080213231607-9x5ea54snffyzeu4 613 z-...@us...-20080213231745-t7gutswv6pm0d9ts 614 z-...@us...-20080213235902-yct0jy7rtc8rm0ey 615 z-...@us...-20080213235919-8tl1388zcggq9tzc 616 z-...@us...-20080214082816-dfdjmj4fm9vy6orh 618 z-...@us...-20080214125233-3nrgfrnzogj7nmu7 619 z-...@us...-20080214130153-c49jc9bo0yq6wcun 620 z-...@us...-20080214125233-13kffzv1qhyqfh1g 621 z-...@us...-20080214143550-ovwirpmzh2demiau 622 z-...@us...-20080214145926-xh49sbvcmoa3dfnx 623 z-...@us...-20080214152942-i1gwyqby6t3gfsyd 624 z-...@us...-20080214160347-mrqwdogtsvt2jwx6 627 z-...@us...-20080215083038-kpe7i3xxibqs4w3t 630 z-...@us...-20080215113602-1v0jq31ocroi9ien 631 z-...@us...-20080215125814-qrc5baipd0es0f8s 632 z-...@us...-20080215132414-ap75kohnhkyot3io 633 z-...@us...-20080215142819-78at0b7fjz12df4f 634 z-...@us...-20080215144155-vvuudbxe5dfta35q 635 z-...@us...-20080215144410-jq4n72ifnb7fz0q2 636 z-...@us...-20080215202858-10plx59rnos3h3wx 637 z-...@us...-20080215203022-6lmmz1kflk335csv 638 z-...@us...-20080215203921-qhp01ccwowaws5zw 639 z-...@us...-20080215213800-wgwgohw6qj484v1l 640 z-...@us...-20080216125315-tcl1mu3dogdnj4oz 641 z-...@us...-20080216152929-tj517suzlvqe988j 642 z-...@us...-20080216160207-fne52uek26c8xsbq 644 z-...@us...-20080216210312-etwwtuziwqfiee4a 645 z-...@us...-20080216223305-fllgpnypalakrto9 646 z-...@us...-20080216224028-yub72nzo00wuuen6 647 z-...@us...-20080216225216-5dvqho6samx7taz0 648 z-...@us...-20080216233325-5m9la64qlix7yqgm 649 z-...@us...-20080216233406-mjevvwajyd3ttlx3 650 z-...@us...-20080217105133-rsruvt5qroz8x2ev 651 z-...@us...-20080217110247-f5pimrjhvwm3rx8a 652 z-...@us...-20080217151109-n3f7wdio7x2heq7a 653 z-...@us...-20080217151344-nndna800a0t8mj97 655 z-...@us...-20080217223209-fxf60qpiypsv10rx 656 z-...@us...-20080217225340-uv9y4fnalqhokc9z 658 z-...@us...-20080218102004-cdjayf0lz9e02fi4 659 z-...@us...-20080218102004-q7xyz5f56x82q3ya 660 z-...@us...-20080218105535-hy8er6w05toruntx 661 z-...@us...-20080218102004-0vx3aabq0fgbxwp1 662 z-...@us...-20080218113302-hz95tbxan759a49b 665 z-...@us...-20080220221226-vhyt8ef6nmv3wrma 666 z-...@us...-20080229183043-i04z65cxb7azya01 672 z-...@us...-20080229235852-zdhq3v1iwvllb1ch 673 z-...@us...-20080301001554-1n05n5oh6lncev3j 674 z-...@us...-20080304110341-uf7982hzslcgqdz4 675 z-...@us...-20080304113003-9cxdx6ign2beip25 676 z-...@us...-20080304135251-7payt727hknvj051 677 z-...@us...-20080304142133-z44uzew53a4b5ahe 678 z-...@us...-20080304145813-zl9ix8gjzx96x3to 679 z-...@us...-20080304150213-o0zqdvudc2ydckiw 680 z-...@us...-20080304150606-ojhkiuu0nkfsdzxh 681 z-...@us...-20080304153343-11zuw8l4qpy6c804 682 z-...@us...-20080304161108-35q9938k4uz45e7n 683 z-...@us...-20080304162218-0met1wl2hiarehxx 684 z-...@us...-20080304162409-a83mleet1q1oxvyl 685 z-...@us...-20080304163815-eza6ew840zbu3g8t 687 z-...@us...-20080304170429-67o62a20eaf5m71t 688 z-...@us...-20080304170806-ibhma13xv66iqmrn 689 z-...@us...-20080304181719-va2qxujt8xymlvnw 694 z-...@us...-20080305104648-j8yrdtlvn1fbl16f 695 z-...@us...-20080305105143-or3sfnz59o1lrpko 696 z-...@us...-20080305111936-1lkgcc0nxlht67rc 697 z-...@us...-20080305121112-ma05x8g2xxe97577 698 z-...@us...-20080305144132-u1z3dlmqx7w66i57 699 z-...@us...-20080305183702-042b1hpkp4b4131d 700 z-...@us...-20080305213644-2k7zxvqir5qwashd 701 z-...@us...-20080306001417-1xic7kn4id0o48wy 702 z-...@us...-20080306002055-ps9m9ub2pis24h1s 708 z-...@us...-20080306184205-5trimli63k50yw0i 711 z-...@us...-20080307234229-6d37bxl8qwm9p071 712 z-...@us...-20080307234333-he0ahafy7eio8os7 721 z-...@us...-20080308202032-762gimjyorbshgw5 725 z-...@us...-20080309203540-72yytsrt4eh2fpnz 726 z-...@us...-20080309204413-oqf7py0cckchcvuk 727 z-...@us...-20080309204558-5z4x0jbf1qsnlt14 728 z-...@us...-20080310160543-or6d04u4wd2lqf86 729 z-...@us...-20080310204637-m3ny5zti4bz0jut1 730 z-...@us...-20080310210722-3omh1ng139qke53d 735 z-...@us...-20080311214611-on2weees1k1dt8hr 736 z-...@us...-20080311221921-0ohk3zz2ago8uoen 742 z-...@us...-20080314122729-1pzdi3xnnc1oaxhz 743 z-...@us...-20080315004823-6463oolvbj2a2k5e 744 z-...@us...-20080315004845-j5in82malq71kb31 745 z-...@us...-20080315234805-wgdyhfi1ujsqlewo 747 z-...@us...-20080316152908-51424mv65ivsiy0b 748 ep...@fr...-20080316153532-xlki6lf0fjb5wf57 750 epsy-20080317072934-5pr4ygp142kqkqr0 752 z-...@us...-20080317103020-t06zcug1jca7wkad 753 z-...@us...-20080317105914-tugsi7atv1qt0kjm 754 epsy-20080317203445-88howmqbme4na1fi 756 z-...@us...-20080318154654-g2jjh105v55bnlx7 757 z-...@us...-20080318163754-nx4unl68ktk3o2y1 758 z-...@us...-20080318164536-4shuy567zu9yzfy5 761 z-...@us...-20080318190251-u8vth8wwcy0bv6wm 762 z-...@us...-20080318191455-0ushdbdwzw0xdei7 763 z-...@us...-20080318193704-uey2w3pj1rk7hv98 765 z-...@us...-20080318200922-fif4v3t16bqjkb98 767 z-...@us...-20080318204138-hfwol9rkawm83qq8 772 z-...@us...-20080319185658-33i263bew6glphlo 773 z-...@us...-20080319191210-vzr9cnahx7lnq8vn 774 epsy-20080319191936-4mv6w2p4clrg5xqp 775 epsy-20080319192123-r1jjinuafv028u6w 777 z-...@us...-20080319202314-36j2sl34bdnxv42a 779 z-...@us...-20080320120501-17v2020goqsm3uy9 780 z-...@us...-20080320122108-fxon3du35opw4w9l 781 z-...@us...-20080320122804-p78fl209ouit4rac 782 z-...@us...-20080320124133-ogwmpgzawf7k7mb9 783 z-...@us...-20080320153458-kzpvdq4ot20jq2ys 784 z-...@us...-20080320154738-1hqwrdd4ur85t0wc 785 z-...@us...-20080320161752-z16barxhajr6g3u1 790 wrt...@us...-20080324114314-ovpngfceabgdrjw1 791 z-...@us...-20080324140643-mi4bbst3otkixvxr 792 z-...@us...-20080324140702-my3a8324osylxu5w 793 z-...@us...-20080324150602-8qcaza12xvnb5656 794 z-...@us...-20080324150903-102wwxv4ftujx0ri 795 z-...@us...-20080324200209-697loupzo7vful5m 796 z-...@us...-20080324201344-ltgkffdh25bca1h1 797 z-...@us...-20080324201704-t8ojf8wo6yuf0w3q 798 z-...@us...-20080325142406-elvu8lo7f1vpqykf 801 z-...@us...-20080408225027-z6jtik5hyyvh1r3k 802 epsy-20080409143340-tmynld6yvx0hrupq 803 epsy-20080409161853-5dyty0sra1j4wu20 804 epsy-20080410203444-uv8005sqv29niznl 805 epsy-20080410210652-4v8qz498xx2xf9gm 806 epsy-20080412215911-an0ciuot2xcw0j3e 807 wrt...@us...-20080413150948-6st3fg3amcpljyrs 808 z-...@us...-20080415221847-luq99q83qk1kf0qj 810 ep...@fr...-20080419003256-1d34b0frf3sghbgt 811 wrt...@us...-20080419181752-qybwic6wstifb6xi Name: svn:ignore + config.sub install-sh Eclipse* configure version.h CVS doc_bak log leak.history config.cache config.log .gdbinit config.h Makefile leak.log diff scorelog.txt ladder.txt highscores.txt config.status won_matches.txt mainicon.ico .dont_update screenshot_1.bmp won_rounds.txt Makefile.global memprofile* frommaster.srv screenshot* ml astat master bindist master_list.srv big_brother master.srv *.dll *.ilk README.txt README-SDL.txt update.bat tagcvs .infiles autom4te.cache config.h.stamp Testme html.m4 var ded .beautytag* config.h.in aclocal.m4 ChangeLog INSTALL Makefile.in missing COPYING version depcomp .version.new .cvsfiles stamp-h1 touch universal_variable_substitutions universal_variable_values.in universal_variables extrapaths universal_variable_values_makefile macosx_build_information.yml Modified: armagetronad/branches/0.2.8/armagetronad/NEWS =================================================================== --- armagetronad/branches/0.2.8/armagetronad/NEWS 2008-04-18 22:39:54 UTC (rev 8413) +++ armagetronad/branches/0.2.8/armagetronad/NEWS 2008-04-19 18:46:18 UTC (rev 8417) @@ -74,6 +74,9 @@ "[L] " - PLAYER_MESSAGE <user ID or name> <Message>: Like /msg, but from the console +- All ladderlog outputs can be enabled or disabled separately by using + LADDERLOG_WRITE_*. LADDERLOG_WRITE_ALL enables or disables all ladderlog + output alltogether. If --enable-armathentication was activated: - /lock, /unlock, /invite and /uninvite team management chat for players of Modified: armagetronad/branches/0.2.8/armagetronad/language/english_base.txt =================================================================== --- armagetronad/branches/0.2.8/armagetronad/language/english_base.txt 2008-04-18 22:39:54 UTC (rev 8413) +++ armagetronad/branches/0.2.8/armagetronad/language/english_base.txt 2008-04-19 18:46:18 UTC (rev 8417) @@ -715,6 +715,10 @@ console_decorate_id_help Decorates every line of console output with the client ID console_decorate_ip_help Decorates every line of console output with the client IP console_ladder_log_help Sends ladder log output to the console +ladderlog_write_all_help Set all the LADDER_LOG_WRITE_* settings to the same value +ladderlog_write_all_usage Usage: LADDER_LOG_WRITE_ALL 1|0 +ladderlog_write_all_enabled Enabled full ladderlog output. +ladderlog_write_all_disabled Disabled ladderlog output. ladderlog_game_time_interval If nonnegative, write a line with the current game time to the ladder log every n seconds. show_fps_help Enable fps display floor_mirror_help Floor mirror mode Modified: armagetronad/branches/0.2.8/armagetronad/src/engine/ePlayer.cpp =================================================================== --- armagetronad/branches/0.2.8/armagetronad/src/engine/ePlayer.cpp 2008-04-18 22:39:54 UTC (rev 8413) +++ armagetronad/branches/0.2.8/armagetronad/src/engine/ePlayer.cpp 2008-04-19 18:46:18 UTC (rev 8417) @@ -41,6 +41,7 @@ #include <fstream> #include <iostream> #include <deque> +#include <algorithm> #include "rRender.h" #include "rSysdep.h" #include "nAuthentication.h" @@ -798,6 +799,8 @@ se_SecretConsoleOut( message, hider->GetAccessLevel(), hider, admin ); } +static eLadderLogWriter se_authorityBlurbWriter("AUTHORITY_BLURB", true); + static void ResultCallback( nKrawall::nCheckResult const & result ) { tString username = result.username; @@ -838,10 +841,8 @@ s >> token; rest.ReadLine( s ); - std::ostringstream o; - o << "AUTHORITY_BLURB_" << token << " " << player->GetFilteredAuthenticatedName() << " " << rest << std::endl; - - se_SaveToLadderLog( o.str().c_str() ); + se_authorityBlurbWriter << token << player->GetFilteredAuthenticatedName() << rest; + se_authorityBlurbWriter.write(); } } else @@ -4034,6 +4035,8 @@ static nDescriptor player_removed_from_game(202,&player_removed_from_game_handler,"player_removed_from_game"); +static eLadderLogWriter se_playerLeftWriter("PLAYER_LEFT", true); + void ePlayerNetID::RemoveFromGame() { // unregister with the machine @@ -4069,8 +4072,8 @@ if ( IsHuman() && sn_GetNetState() == nSERVER && NULL != sn_Connections[Owner()].socket ) { tString ladder; - ladder << "PLAYER_LEFT " << userName_ << " " << nMachine::GetMachine(Owner()).GetIP() << "\n"; - se_SaveToLadderLog(ladder); + se_playerLeftWriter << userName_ << nMachine::GetMachine(Owner()).GetIP(); + se_playerLeftWriter.write(); } } } @@ -5010,17 +5013,76 @@ { if (se_consoleLadderLog) { - std::cout << "[L] " << out; - std::cout.flush(); + std::cout << "[L] " << out << std::endl; } if (sn_GetNetState()!=nCLIENT && !tRecorder::IsPlayingBack()) { std::ofstream o; if ( tDirectories::Var().Open(o, "ladderlog.txt", std::ios::app) ) - o << out; + o << out << std::endl;; } } +std::list<eLadderLogWriter *> &eLadderLogWriter::writers() { + static std::list<eLadderLogWriter *> list; + return list; +} + +eLadderLogWriter::eLadderLogWriter(char const *ID, bool enabledByDefault) : + id(ID), + enabled(enabledByDefault), + conf(new tSettingItem<bool>(&(tString("LADDERLOG_WRITE_") + id)(0), + enabled)), + cache(id) { + writers().push_back(this); +} + +eLadderLogWriter::~eLadderLogWriter() { + if(conf) { + delete conf; + } + // generic algorithms aren't exactly easier to understand than regular + // code, but anyways, let's try one... + std::list<eLadderLogWriter *> list = writers(); + list.erase(std::find_if(list.begin(), list.end(), std::bind2nd(std::equal_to<eLadderLogWriter *>(), this))); +} + +void eLadderLogWriter::write() { + if(enabled) { + se_SaveToLadderLog(cache); + } + cache = id; +} + +void eLadderLogWriter::setAll(bool enabled) { + std::list<eLadderLogWriter *> list = writers(); + std::list<eLadderLogWriter *>::iterator end = list.end(); + for(std::list<eLadderLogWriter *>::iterator iter = list.begin(); iter != end; ++iter) { + (*iter)->enabled = enabled; + } +} + +static void LadderLogWriteAll(std::istream &s) { + bool enabled; + s >> enabled; + if(s.fail()) { + if(tConfItemBase::printErrors) { + con << tOutput("$ladderlog_write_all_usage") << '\n'; + } + return; + } + if(tConfItemBase::printChange) { + if(enabled) { + con << tOutput("$ladderlog_write_all_enabled") << '\n'; + } else { + con << tOutput("$ladderlog_write_all_disabled") << '\n'; + } + } + eLadderLogWriter::setAll(enabled); +} + +static tConfItemFunc LadderLogWriteAllConf("LADDERLOG_WRITE_ALL", &LadderLogWriteAll); + void se_SaveToScoreFile(const tOutput &o){ tString s(o); @@ -5273,6 +5335,9 @@ return ret; } +static eLadderLogWriter se_onlinePlayerWriter("ONLINE_PLAYER", false); +static eLadderLogWriter se_numHumansWriter("NUM_HUMANS", false); + void ePlayerNetID::RankingLadderLog() { SortByScore(); @@ -5282,24 +5347,19 @@ ePlayerNetID *p = se_PlayerNetIDs(i); if(p->Owner() == 0) continue; // ignore AIs - tString line("ONLINE_PLAYER "); + se_onlinePlayerWriter << p->GetLogName(); - line << p->GetLogName(); - if(p->IsActive()) { - line << " " << p->ping; + se_onlinePlayerWriter << p->ping; if(p->currentTeam) { - line << " " << FilterName(p->currentTeam->Name()); + se_onlinePlayerWriter << FilterName(p->currentTeam->Name()); ++num_humans; } } - - line << '\n'; - se_SaveToLadderLog(line); + se_onlinePlayerWriter.write(); } - tString line("NUM_HUMANS "); - line << num_humans << '\n'; - se_SaveToLadderLog(line); + se_numHumansWriter << num_humans; + se_numHumansWriter.write(); } void ePlayerNetID::ClearAll(){ @@ -6904,6 +6964,9 @@ static gServerInfoAdmin sg_serverAdmin; +static eLadderLogWriter se_playerEnteredWriter("PLAYER_ENTERED", true); +static eLadderLogWriter se_playerRenamedWriter("PLAYER_RENAMED", true); + class eNameMessenger { public: @@ -6941,9 +7004,8 @@ { if ( player_.IsHuman() ) { - tString ladder; - ladder << "PLAYER_ENTERED " << logName << " " << nMachine::GetMachine(player_.Owner()).GetIP() << " " << screenName << "\n"; - se_SaveToLadderLog(ladder); + se_playerEnteredWriter << logName << nMachine::GetMachine(player_.Owner()).GetIP() << screenName; + se_playerEnteredWriter.write(); player_.Greet(); @@ -6957,9 +7019,8 @@ } else if ( logName != oldLogName_ || screenName != oldScreenName_ ) { - tString ladder; - ladder << "PLAYER_RENAMED " << oldLogName_ << " " << logName << " " << nMachine::GetMachine(player_.Owner()).GetIP() << " " << screenName << "\n"; - se_SaveToLadderLog(ladder); + se_playerRenamedWriter << oldLogName_ << logName << nMachine::GetMachine(player_.Owner()).GetIP() << screenName; + se_playerRenamedWriter.write(); if ( oldScreenName_ != screenName ) { @@ -7699,18 +7760,18 @@ //! // ******************************************************************************* +static eLadderLogWriter se_roundScoreWriter("ROUND_SCORE", true); + void ePlayerNetID::LogScoreDifference( void ) { if ( lastScore_ > IMPOSSIBLY_LOW_SCORE && IsHuman() ) { - tString ret; int scoreDifference = score - lastScore_; lastScore_ = IMPOSSIBLY_LOW_SCORE; - ret << "ROUND_SCORE " << scoreDifference << " " << GetUserName(); + se_roundScoreWriter << scoreDifference << GetUserName(); if ( currentTeam ) - ret << " " << FilterName( currentTeam->Name() ); - ret << "\n"; - se_SaveToLadderLog( ret ); + se_roundScoreWriter << FilterName( currentTeam->Name() ); + se_roundScoreWriter.write(); } } Modified: armagetronad/branches/0.2.8/armagetronad/src/engine/ePlayer.h =================================================================== --- armagetronad/branches/0.2.8/armagetronad/src/engine/ePlayer.h 2008-04-18 22:39:54 UTC (rev 8413) +++ armagetronad/branches/0.2.8/armagetronad/src/engine/ePlayer.h 2008-04-19 18:46:18 UTC (rev 8417) @@ -45,6 +45,7 @@ #include "nSpamProtection.h" #include <set> +#include <list> #define PLAYER_CONFITEMS (30+MAX_INSTANT_CHAT) @@ -417,8 +418,29 @@ void se_ChatState( ePlayerNetID::ChatFlags flag, bool cs); void se_SaveToScoreFile( tOutput const & out ); //!< writes something to scorelog.txt -void se_SaveToLadderLog( tOutput const & out ); //!< writes something to ladderlog.txt +//! create a global instance of this to write stuff to ladderlog.txt +class eLadderLogWriter { + static std::list<eLadderLogWriter *> &writers(); + tString id; + bool enabled; + tSettingItem<bool> *conf; + tColoredString cache; +public: + eLadderLogWriter(char const *ID, bool enabledByDefault); + ~eLadderLogWriter(); + //! append a field to the current message. Spaces are added automatically. + template<typename T> eLadderLogWriter &operator<<(T const &s) { + if(enabled) { + cache << ' ' << s; + } + return *this; + } + void write(); //!< send to ladderlog and clear message + + static void setAll(bool enabled); //!< enable or disable all writers +}; + tColoredString & operator << (tColoredString &s,const ePlayer &p); tColoredString & operator << (tColoredString &s,const ePlayerNetID &p); Modified: armagetronad/branches/0.2.8/armagetronad/src/engine/eTeam.cpp =================================================================== --- armagetronad/branches/0.2.8/armagetronad/src/engine/eTeam.cpp 2008-04-18 22:39:54 UTC (rev 8413) +++ armagetronad/branches/0.2.8/armagetronad/src/engine/eTeam.cpp 2008-04-19 18:46:18 UTC (rev 8417) @@ -464,6 +464,8 @@ //! // ******************************************************************************* +static eLadderLogWriter se_roundScoreTeamWriter("ROUND_SCORE_TEAM", true); + void eTeam::LogScoreDifference( void ) { if ( lastScore_ > IMPOSSIBLY_LOW_SCORE && IsHuman() ) @@ -471,9 +473,8 @@ tString ret; int scoreDifference = score - lastScore_; lastScore_ = IMPOSSIBLY_LOW_SCORE; - ret << "ROUND_SCORE_TEAM " << scoreDifference << " " << ePlayerNetID::FilterName( Name() ); - ret << "\n"; - se_SaveToLadderLog( ret ); + se_roundScoreTeamWriter << scoreDifference << ePlayerNetID::FilterName( Name() ); + se_roundScoreTeamWriter.write(); } } Modified: armagetronad/branches/0.2.8/armagetronad/src/tron/gCycle.cpp =================================================================== --- armagetronad/branches/0.2.8/armagetronad/src/tron/gCycle.cpp 2008-04-18 22:39:54 UTC (rev 8413) +++ armagetronad/branches/0.2.8/armagetronad/src/tron/gCycle.cpp 2008-04-19 18:46:18 UTC (rev 8417) @@ -3127,6 +3127,10 @@ } } +static eLadderLogWriter sg_deathFragWriter("DEATH_FRAG", true); +static eLadderLogWriter sg_deathSuicideWriter("DEATH_SUICIDE", true); +static eLadderLogWriter sg_deathTeamkillWriter("DEATH_TEAMKILL", true); + void gCycle::KillAt( const eCoord& deathPos){ // don't kill invulnerable cycles if ( !Vulnerable() ) @@ -3167,9 +3171,8 @@ { if (hunter) { - tString ladderLog; - ladderLog << "DEATH_SUICIDE " << hunter->GetUserName() << "\n"; - se_SaveToLadderLog( ladderLog ); + sg_deathSuicideWriter << hunter->GetUserName(); + sg_deathSuicideWriter.write(); if ( score_suicide ) hunter->AddScore(score_suicide, tOutput(), "$player_lose_suicide" ); @@ -3192,9 +3195,8 @@ preyName << *Player(); preyName << tColoredString::ColorString(1,1,1); if (Player()->CurrentTeam() != hunter->CurrentTeam()) { - tString ladderLog; - ladderLog << "DEATH_FRAG " << Player()->GetUserName() << " " << hunter->GetUserName() << "\n"; - se_SaveToLadderLog( ladderLog ); + sg_deathFragWriter << Player()->GetUserName() << hunter->GetUserName(); + sg_deathFragWriter.write(); win.SetTemplateParameter(3, preyName); win << "$player_win_frag"; @@ -3208,9 +3210,8 @@ } } else { - tString ladderLog; - ladderLog << "DEATH_TEAMKILL " << Player()->GetUserName() << " " << hunter->GetUserName() << "\n"; - se_SaveToLadderLog( ladderLog ); + sg_deathTeamkillWriter << Player()->GetUserName() << hunter->GetUserName(); + sg_deathTeamkillWriter.write(); tColoredString hunterName; hunterName << *hunter << tColoredString::ColorString(1,1,1); @@ -3319,6 +3320,8 @@ cycle.Player()->AddScore( score_hole, tOutput("$player_win_hole"), tOutput("$player_lose_hole") ); } +static eLadderLogWriter sg_sacrificeWriter("SACRIFICE", true); + void gCycle::PassEdge(const eWall *ww,REAL time,REAL a,int){ { // deactivate time check @@ -3348,9 +3351,8 @@ // this test must come last, it resets the flag. if ( explosion->AccountForHole() ) { - tString ladderLog; - ladderLog << "SACRIFICE " << Player()->GetUserName() << " " << holer->Player()->GetUserName() << " " << w->Cycle()->Player()->GetUserName() << "\n"; - se_SaveToLadderLog( ladderLog ); + sg_sacrificeWriter << Player()->GetUserName() << holer->Player()->GetUserName() << w->Cycle()->Player()->GetUserName(); + sg_sacrificeWriter.write(); if ( score_hole > 0 ) { // positive hole score goes to the holer Modified: armagetronad/branches/0.2.8/armagetronad/src/tron/gGame.cpp =================================================================== --- armagetronad/branches/0.2.8/armagetronad/src/tron/gGame.cpp 2008-04-18 22:39:54 UTC (rev 8413) +++ armagetronad/branches/0.2.8/armagetronad/src/tron/gGame.cpp 2008-04-19 18:46:18 UTC (rev 8417) @@ -1811,6 +1811,7 @@ } #endif +static eLadderLogWriter sg_gameEndWriter("GAME_END", true); static void own_game( nNetState enter_state ){ tNEW(gGame); @@ -1820,7 +1821,7 @@ // write scores one last time ePlayerNetID::LogScoreDifferences(); - se_SaveToLadderLog(tString("GAME_END\n")); + sg_gameEndWriter.write(); sg_currentGame=NULL; se_KillGameTimer(); @@ -3028,6 +3029,10 @@ } } +static eLadderLogWriter sg_newRoundWriter("NEW_ROUND", true); +static eLadderLogWriter sg_newMatchWriter("NEW_MATCH", true); +static eLadderLogWriter sg_waitForExternalScriptWriter("WAIT_FOR_EXTERNAL_SCRIPT", true); + void gGame::StateUpdate(){ // if (state==GS_CREATED) @@ -3086,7 +3091,7 @@ // log scores before players get renamed ePlayerNetID::LogScoreDifferences(); - se_SaveToLadderLog(tString("NEW_ROUND\n")); + sg_newRoundWriter.write(); // kick spectators nMachine::KickSpectators(); @@ -3302,7 +3307,7 @@ REAL timeout = tSysTimeFloat() + sg_waitForExternalScriptTimeout; if ( sg_waitForExternalScript ) { - se_SaveToLadderLog("WAIT_FOR_EXTERNAL_SCRIPT\n"); + sg_waitForExternalScriptWriter.write(); // REAL waitingSince = tSysTimeFloat(); } while ( sg_waitForExternalScript && timeout > tSysTimeFloat()) @@ -3478,6 +3483,9 @@ static REAL sg_winZoneRandomness = .8; static tSettingItem< REAL > sg_winZoneSpreadConf( "WIN_ZONE_RANDOMNESS", sg_winZoneRandomness ); +static eLadderLogWriter sg_roundWinnerWriter("ROUND_WINNER", true); +static eLadderLogWriter sg_matchWinnerWriter("MATCH_WINNER", true); + void gGame::Analysis(REAL time){ if ( nCLIENT == sn_GetNetState() ) return; @@ -3811,9 +3819,8 @@ message << '\n'; se_SaveToScoreFile(message); - tString ladderLog; - ladderLog << "ROUND_WINNER " << ePlayerNetID::FilterName( eTeam::teams[winner-1]->Name() ) << "\n"; - se_SaveToLadderLog( ladderLog ); + sg_roundWinnerWriter << ePlayerNetID::FilterName( eTeam::teams[winner-1]->Name() ); + sg_roundWinnerWriter.write(); } } check_hs(); @@ -3883,9 +3890,8 @@ name << eTeam::teams[0]->Name(); name << tColoredString::ColorString(1,1,1); - tString ladderLog; - ladderLog << "MATCH_WINNER " << ePlayerNetID::FilterName( eTeam::teams[0]->Name() ) << "\n"; - se_SaveToLadderLog( ladderLog ); + sg_matchWinnerWriter << ePlayerNetID::FilterName( eTeam::teams[0]->Name() ); + sg_matchWinnerWriter.write(); message.SetTemplateParameter(1, name); message << "$gamestate_champ_console"; @@ -3990,7 +3996,7 @@ void gGame::StartNewMatchNow(){ if ( rounds != 0 ) - se_SaveToLadderLog(tString("NEW_MATCH\n")); + sg_newMatchWriter.write(); rounds=0; warning=0; @@ -4055,6 +4061,8 @@ static uActionGlobalFunc ingamemenu_action(&ingamemenu,&ingamemenu_func, true ); #endif // dedicated +static eLadderLogWriter sg_gameTimeWriter("GAME_TIME", true); + bool gGame::GameLoop(bool input){ nNetState netstate = sn_GetNetState(); @@ -4208,9 +4216,8 @@ static float lastTime = -1; if(sg_gameTimeInterval >= 0 && (gtime >= lastTime + sg_gameTimeInterval || (gtime < lastTime && gtime >= 0))) { - tOutput out; - out << "GAME_TIME " << gtime << '\n'; - se_SaveToLadderLog(out); + sg_gameTimeWriter << gtime; + sg_gameTimeWriter.write(); lastTime = gtime; } Modified: armagetronad/branches/0.2.8/armagetronad/src/tron/gWinZone.cpp =================================================================== --- armagetronad/branches/0.2.8/armagetronad/src/tron/gWinZone.cpp 2008-04-18 22:39:54 UTC (rev 8413) +++ armagetronad/branches/0.2.8/armagetronad/src/tron/gWinZone.cpp 2008-04-19 18:46:18 UTC (rev 8417) @@ -996,14 +996,16 @@ //! // ******************************************************************************* +static eLadderLogWriter sg_basezoneConqueredWriter("BASEZONE_CONQUERED", true); +static eLadderLogWriter sg_basezoneConquererWriter("BASEZONE_CONQUERER", true); + void gBaseZoneHack::OnConquest( void ) { - tString log; if ( team ) { - log << "BASEZONE_CONQUERED " << ePlayerNetID::FilterName(team->Name()) << " " << GetPosition().x << " " << GetPosition().y << '\n'; + sg_basezoneConqueredWriter << ePlayerNetID::FilterName(team->Name()) << GetPosition().x << GetPosition().y; + sg_basezoneConqueredWriter.write(); } - se_SaveToLadderLog(log); float rr = GetRadius(); rr *= rr; for(int i = se_PlayerNetIDs.Len()-1; i >=0; --i) { @@ -1016,9 +1018,8 @@ continue; } if(cycle->Alive() && (cycle->Position() - Position()).NormSquared() < rr) { - tString log; - log << "BASEZONE_CONQUERER " << player->GetUserName() << '\n'; - se_SaveToLadderLog(log); + sg_basezoneConquererWriter << player->GetUserName(); + sg_basezoneConquererWriter.write(); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |