From: <baz...@us...> - 2009-02-28 20:38:12
|
Revision: 9085 http://armagetronad.svn.sourceforge.net/armagetronad/?rev=9085&view=rev Author: bazaarmagetron Date: 2009-02-28 20:37:58 +0000 (Sat, 28 Feb 2009) Log Message: ----------- Manuel Moos: No longer wasing network message IDs for messages that don't need acks. Modified Paths: -------------- armagetronad/trunk/armagetronad/src/network/nNetwork.cpp armagetronad/trunk/armagetronad/src/network/nNetwork.h armagetronad/trunk/armagetronad/src/network/nProtoBuf.cpp armagetronad/trunk/armagetronad/src/network/nProtoBuf.h armagetronad/trunk/armagetronad/src/network/nStreamMessage.cpp armagetronad/trunk/armagetronad/src/network/nStreamMessage.h Property Changed: ---------------- armagetronad/trunk/armagetronad/ Property changes on: armagetronad/trunk/armagetronad ___________________________________________________________________ Modified: bzr:revision-info - timestamp: 2009-02-27 22:25:39.779000044 +0100 committer: Manuel Moos <z-...@us...> properties: branch-nick: armagetronad + timestamp: 2009-02-28 20:14:47.447999954 +0100 committer: Manuel Moos <z-...@us...> properties: branch-nick: armagetronad Modified: bzr:file-ids - src/protobuf/Makefile.am makefile.am-20090227212533-o6cy1zlhtl53eslw-1 + Modified: bzr:revision-id:v3-list-QlpoOTFBWSZTWZvbKhsAAAdRgAAQABK6798QIABURMgAAaeoNT1TxT1DQbKaeobXKiyAmlWT7Y5MkdJOtXDtB7w7DOGFBHiOBxaUIu7HQyyQSvxdyRThQkJvbKhs - 613 z-...@us...-20080211141509-cwbrb6hmtz9313jr 626 z-...@us...-20080214170110-rhfpd874zuogr3cm 627 z-...@us...-20080214170244-1gstsfe9yzyvrx9b 657 z-...@us...-20080301093905-0jwh1zg9srukp8fn 678 wrt...@us...-20080320130546-cr72y7d9q5a8nk7a 679 z-...@us...-20080324202056-eybvkm0gjomywbcq 680 z-...@us...-20080326104303-kpkkrwiw1fioi0rd 681 epsy-20080327213346-setzm7umdzzuk2dm 683 wrt...@us...-20080402122117-54nak33inuca02o9 684 wrt...@us...-20080402122804-2xhc8bgyrjsa09cd 685 wrt...@us...-20080418093840-cxtpql4xw2vsbmyn 686 ep...@fr...-20080418200503-q16s8az3yewn4x7a 687 ep...@fr...-20080419004917-bq4vguy9vpbkmlo3 688 wrt...@us...-20080419185850-ksm1feadrrhqigjb 689 wrt...@us...-20080423170738-zb8v72r0asm7cp52 691 ep...@fr...-20080427145818-212ave5ohdhth4ph 692 epsy46-20080428164518-07b9wsj90rf82c3y 693 epsy46-20080429194430-hq3fd6i1mnz1vrnz 694 ep...@fr...-20080518131839-uik8hj18c55boh3m 696 z-...@us...-20080618212520-e6ov1rb9b9edwt30 697 wrt...@us...-20080708142300-tu6f7ag7ak0yhdrf 698 wrt...@us...-20080727173310-pv1vq0wj01yfwgfl 699 da...@da...-20080824021014-8aacq5gfp7ktxlxz 700 da...@da...-20080824055426-l5dwhb216uteu7ca 701 da...@da...-20080824172432-lvagd99j28hq8uc1 702 da...@da...-20080824225545-ply97boo9jkqtysn 704 ep...@fr...-20081027173216-nh6d92edtwe35j2g 705 ep...@fr...-20081027203505-42bpegw0fyywzyou 706 ep...@fr...-20081027204727-jcx89jukht9ay72r 707 ep...@fr...-20081028180734-62o6e90rf020xzv8 708 ep...@fr...-20081028224044-f3myemuy87v52ilp 709 ep...@fr...-20081110193848-iksu9rmzzi7jb0qq 710 ep...@fr...-20081114212232-i1q12n375bdpl0sp 712 z-...@us...-20081211141049-wbjceadupsfss5ib 713 da...@da...-20081216223143-1hso83uxyagaubg8 716 lee...@gm...-20081220084635-zv6bpm9rar9yufy7 717 lee...@gm...-20081220085046-6rwe6cqmdlffs4rl 718 lee...@gm...-20081220085502-gpad43pu99t1e6po 719 lee...@gm...-20081220092821-q7uj4w92j6a3a7eb 720 lee...@gm...-20081220094339-k3zb139qp87r4b2w 721 lee...@gm...-20081220100858-uap7k5s22tbipzkt 722 lee...@gm...-20081220111203-rhp5p15agx73xi1k 723 lee...@gm...-20081220112757-mjp2yffddjy5s74e 724 lee...@gm...-20081220114653-k2dqt4wiizipbwas 725 lee...@gm...-20081221181637-6d0tfx7sx7syxfb6 726 lee...@gm...-20081221182603-9bkelm9x7aclb0bw 734 lee...@gm...-20081230173103-fmzio9fanap2rybf 735 lee...@gm...-20081230174204-cppkz4sumguhysa9 736 lee...@gm...-20081230174738-mecjttlpyp1i859c 737 lee...@gm...-20081230174816-qmtp2a3q8m52jsn3 738 lee...@gm...-20081230194247-q6oyx6cqfz03b2lr 739 lee...@gm...-20081231202038-odzabc3wmlqzvskt 740 lee...@gm...-20081231203835-nn2kezh1el82dn1q 741 lee...@gm...-20090101022727-myjxnrvqe5e4l1wz 743 da...@da...-20090103170253-cdtppjz8nzwhngst 744 da...@da...-20090103183413-r1852m22og3lh2uc 745 lee...@gm...-20090103212852-mvsergjd4ao1la77 746 da...@da...-20090103231550-6zn9qzo6gpj9kwu8 748 da...@da...-20090105115751-x3y9oui4xvt43crj 749 da...@da...-20090105131244-nljbq3qp4hp7lg07 750 da...@da...-20090105192648-inoxhljmqqe3dgw7 751 da...@da...-20090105192806-vhrs9hj8nr4lrdp0 752 da...@da...-20090106194428-nwwwyljr8wn3pwq1 753 da...@da...-20090106194753-82zu5xfqfzbnk9k9 754 da...@da...-20090106202104-5z9836ych2di2jlo 755 da...@da...-20090106234335-aolp3kr0gasjmbri 756 da...@da...-20090106234811-p3el5s40j0upvyql 757 da...@da...-20090107021107-5kbemotp1sco4ncp 758 da...@da...-20090107051447-8ncvyikf3aadgz3a 759 da...@da...-20090107071255-jhqi9p9212levb60 760 z-...@us...-20090107105902-l6x07af4hr2py066 761 z-...@us...-20090107111842-2o0fqp72oxz55jri 762 z-...@us...-20090107113141-mo1g3b0jgzhyj001 763 z-...@us...-20090107113517-dsyf4f6jroj6dr9e 764 z-...@us...-20090107114151-9n5m6mvsq9nh33p1 770 z-...@us...-20090111232523-lnab7ymhxk94pdh1 771 z-...@us...-20090111232619-ukmmx5gfarcoiipi 772 z-...@us...-20090111233014-dazt93cibmg56v3i 774 z-...@us...-20090112103858-psygqhxdmdaer8iz 775 z-...@us...-20090112104018-jik2mqnc14fg5bdk 776 z-...@us...-20090112104123-hvkx0sxhs9wz706b 777 z-...@us...-20090112114514-v1u04w5v83ai75lz 778 z-...@us...-20090112115926-ltqy35euxny3n7zc 779 lee...@gm...-20090112192634-vs5qzckrwxphs3k5 780 lee...@gm...-20090112194338-2zfak9nrxm961yh5 781 lee...@gm...-20090112194729-dlonazcnq20npwqk 782 lee...@gm...-20090112211701-prgmu1fh3p33tz1j 783 lee...@gm...-20090112212513-ojbb1zz98kk1mmzf 784 lee...@gm...-20090112214315-r8akrgn38um8llfc 785 z-...@us...-20090115005714-uscid6wcwnjqzcht 787 z-...@us...-20090116155610-s9rvqacdyl4uu2ym 788 z-...@us...-20090116160116-47he0b9dhkvzfo8e 789 z-...@us...-20090116160130-yu0foyldpp0w651o 794 z-...@us...-20090119152329-7zjbhlxicmzrs3st 795 z-...@us...-20090119152406-eh33pwel5c1ev3tn 796 z-...@us...-20090124222920-5j301djumy6o30js 797 lee...@gm...-20090125161331-yk5t26dos9w7vqh3 798 lee...@gm...-20090125161412-uqkzofyzrzbw5fku 799 z-...@us...-20090125215052-nlr7n742el563xdo 801 z-...@us...-20090126114408-qusodq3le7x4cxmu 802 z-...@us...-20090126114433-hel0im4ncfqun48y 805 z-...@us...-20090126205856-miq23b488w0ybg08 806 z-...@us...-20090126213956-zvazq7x917mgwgcx 807 z-...@us...-20090127091358-zyxrvmeiem90y980 808 z-...@us...-20090127091531-1nu13tf1ylwyfeu2 809 z-...@us...-20090127091641-9ejvsyc3pnqwcquk 811 z-...@us...-20090127214457-3xlqb0gqbff5fzrp 812 z-...@us...-20090127215738-ef3azdi8gyejpmod 814 z-...@us...-20090128112925-ae2c03271u9dfxhw 815 z-...@us...-20090128120342-mbnkieilhllj4p4i 816 z-...@us...-20090128120737-3ln3obsj4d6tqn2a 818 lee...@gm...-20090131032714-zj324yiwx4wni02q 819 ep...@fr...-20090125161823-9dd0qka61mwcz3c1 820 ep...@fr...-20090131143119-vb7l6bbps0mq4nz0 821 wrt...@us...-20090131191353-72oxaevmd0c43bcd 822 wrt...@us...-20090131192158-su1i1fq7a22l8m4t 823 wrt...@us...-20090131202016-24mecfpuyglq88bm 824 lee...@gm...-20090201001131-102ieca1w2tgx88j 825 lee...@gm...-20090201001411-lgn4q6qa50huba5h 826 lee...@gm...-20090201005238-sbzpnl8po5nz4p0p 827 lee...@gm...-20090201005537-esbp0iuxn2wq9ngh 830 z-...@us...-20090202133840-7iwg1phjzr3uzssl 831 lee...@gm...-20090202152533-iya7luyiiaimmann 832 ep...@fr...-20090202212943-20822j01vxylgi1c 833 lee...@gm...-20090207183547-3l0rhwd4b1cb6ksi 837 lee...@gm...-20090212204958-7qcxyvg6gg25zjaj 841 z-...@us...-20090217081732-6jpvxz8o92sti37z 842 z-...@us...-20090217100425-q62s7uu2j4h9keq4 843 z-...@us...-20090217223904-w2fk3zhgjs0s0t55 844 z-...@us...-20090217224702-zs3dd362cll5szp7 845 z-...@us...-20090219175237-ynhe2ijn23bj3824 846 z-...@us...-20090221110006-fgbl1dk4q41b7x1f 848 z-...@us...-20090223100007-f7epfrh7lfmpv5t9 849 z-...@us...-20090224115230-pgv2rxw6412ndwcx 850 z-...@us...-20090224121247-g8ycdgh9m2dn6yth 854 wrt...@us...-20090227072038-tpfjivi0uhpgrl1a 856 z-...@us...-20090227114018-torvxxmcdpf66wwu 857 z-...@us...-20090227114224-sp0ihfus7xw2fcfv 858 z-...@us...-20090227122808-o2h53nb648qvcwb3 859 z-...@us...-20090227122836-k2jjl684gaico2p1 860 z-...@us...-20090227123920-flur7p6h2g24a0hm 861 z-...@us...-20090227143152-4nay9c5k5zzmdrr3 862 lee...@gm...-20090227182603-mo7djpl31xkh38bv 863 z-...@us...-20090227201048-rin598t8m9fctjf7 864 z-...@us...-20090227201140-fnx5r434n3urmz3i 865 z-...@us...-20090227204211-qwwrnbjkx3knmbko 866 z-...@us...-20090227204603-w8nle3nyd4r5ldng 867 z-...@us...-20090227205040-xqmbjcv8nxwt9t9z 868 z-...@us...-20090227205731-2m1v554bbt2qhxes 869 z-...@us...-20090227210145-bij5hlj5x82u461d 870 z-...@us...-20090227212539-wmt09xs5wb72jal9 + 613 z-...@us...-20080211141509-cwbrb6hmtz9313jr 626 z-...@us...-20080214170110-rhfpd874zuogr3cm 627 z-...@us...-20080214170244-1gstsfe9yzyvrx9b 657 z-...@us...-20080301093905-0jwh1zg9srukp8fn 678 wrt...@us...-20080320130546-cr72y7d9q5a8nk7a 679 z-...@us...-20080324202056-eybvkm0gjomywbcq 680 z-...@us...-20080326104303-kpkkrwiw1fioi0rd 681 epsy-20080327213346-setzm7umdzzuk2dm 683 wrt...@us...-20080402122117-54nak33inuca02o9 684 wrt...@us...-20080402122804-2xhc8bgyrjsa09cd 685 wrt...@us...-20080418093840-cxtpql4xw2vsbmyn 686 ep...@fr...-20080418200503-q16s8az3yewn4x7a 687 ep...@fr...-20080419004917-bq4vguy9vpbkmlo3 688 wrt...@us...-20080419185850-ksm1feadrrhqigjb 689 wrt...@us...-20080423170738-zb8v72r0asm7cp52 691 ep...@fr...-20080427145818-212ave5ohdhth4ph 692 epsy46-20080428164518-07b9wsj90rf82c3y 693 epsy46-20080429194430-hq3fd6i1mnz1vrnz 694 ep...@fr...-20080518131839-uik8hj18c55boh3m 696 z-...@us...-20080618212520-e6ov1rb9b9edwt30 697 wrt...@us...-20080708142300-tu6f7ag7ak0yhdrf 698 wrt...@us...-20080727173310-pv1vq0wj01yfwgfl 699 da...@da...-20080824021014-8aacq5gfp7ktxlxz 700 da...@da...-20080824055426-l5dwhb216uteu7ca 701 da...@da...-20080824172432-lvagd99j28hq8uc1 702 da...@da...-20080824225545-ply97boo9jkqtysn 704 ep...@fr...-20081027173216-nh6d92edtwe35j2g 705 ep...@fr...-20081027203505-42bpegw0fyywzyou 706 ep...@fr...-20081027204727-jcx89jukht9ay72r 707 ep...@fr...-20081028180734-62o6e90rf020xzv8 708 ep...@fr...-20081028224044-f3myemuy87v52ilp 709 ep...@fr...-20081110193848-iksu9rmzzi7jb0qq 710 ep...@fr...-20081114212232-i1q12n375bdpl0sp 712 z-...@us...-20081211141049-wbjceadupsfss5ib 713 da...@da...-20081216223143-1hso83uxyagaubg8 716 lee...@gm...-20081220084635-zv6bpm9rar9yufy7 717 lee...@gm...-20081220085046-6rwe6cqmdlffs4rl 718 lee...@gm...-20081220085502-gpad43pu99t1e6po 719 lee...@gm...-20081220092821-q7uj4w92j6a3a7eb 720 lee...@gm...-20081220094339-k3zb139qp87r4b2w 721 lee...@gm...-20081220100858-uap7k5s22tbipzkt 722 lee...@gm...-20081220111203-rhp5p15agx73xi1k 723 lee...@gm...-20081220112757-mjp2yffddjy5s74e 724 lee...@gm...-20081220114653-k2dqt4wiizipbwas 725 lee...@gm...-20081221181637-6d0tfx7sx7syxfb6 726 lee...@gm...-20081221182603-9bkelm9x7aclb0bw 734 lee...@gm...-20081230173103-fmzio9fanap2rybf 735 lee...@gm...-20081230174204-cppkz4sumguhysa9 736 lee...@gm...-20081230174738-mecjttlpyp1i859c 737 lee...@gm...-20081230174816-qmtp2a3q8m52jsn3 738 lee...@gm...-20081230194247-q6oyx6cqfz03b2lr 739 lee...@gm...-20081231202038-odzabc3wmlqzvskt 740 lee...@gm...-20081231203835-nn2kezh1el82dn1q 741 lee...@gm...-20090101022727-myjxnrvqe5e4l1wz 743 da...@da...-20090103170253-cdtppjz8nzwhngst 744 da...@da...-20090103183413-r1852m22og3lh2uc 745 lee...@gm...-20090103212852-mvsergjd4ao1la77 746 da...@da...-20090103231550-6zn9qzo6gpj9kwu8 748 da...@da...-20090105115751-x3y9oui4xvt43crj 749 da...@da...-20090105131244-nljbq3qp4hp7lg07 750 da...@da...-20090105192648-inoxhljmqqe3dgw7 751 da...@da...-20090105192806-vhrs9hj8nr4lrdp0 752 da...@da...-20090106194428-nwwwyljr8wn3pwq1 753 da...@da...-20090106194753-82zu5xfqfzbnk9k9 754 da...@da...-20090106202104-5z9836ych2di2jlo 755 da...@da...-20090106234335-aolp3kr0gasjmbri 756 da...@da...-20090106234811-p3el5s40j0upvyql 757 da...@da...-20090107021107-5kbemotp1sco4ncp 758 da...@da...-20090107051447-8ncvyikf3aadgz3a 759 da...@da...-20090107071255-jhqi9p9212levb60 760 z-...@us...-20090107105902-l6x07af4hr2py066 761 z-...@us...-20090107111842-2o0fqp72oxz55jri 762 z-...@us...-20090107113141-mo1g3b0jgzhyj001 763 z-...@us...-20090107113517-dsyf4f6jroj6dr9e 764 z-...@us...-20090107114151-9n5m6mvsq9nh33p1 770 z-...@us...-20090111232523-lnab7ymhxk94pdh1 771 z-...@us...-20090111232619-ukmmx5gfarcoiipi 772 z-...@us...-20090111233014-dazt93cibmg56v3i 774 z-...@us...-20090112103858-psygqhxdmdaer8iz 775 z-...@us...-20090112104018-jik2mqnc14fg5bdk 776 z-...@us...-20090112104123-hvkx0sxhs9wz706b 777 z-...@us...-20090112114514-v1u04w5v83ai75lz 778 z-...@us...-20090112115926-ltqy35euxny3n7zc 779 lee...@gm...-20090112192634-vs5qzckrwxphs3k5 780 lee...@gm...-20090112194338-2zfak9nrxm961yh5 781 lee...@gm...-20090112194729-dlonazcnq20npwqk 782 lee...@gm...-20090112211701-prgmu1fh3p33tz1j 783 lee...@gm...-20090112212513-ojbb1zz98kk1mmzf 784 lee...@gm...-20090112214315-r8akrgn38um8llfc 785 z-...@us...-20090115005714-uscid6wcwnjqzcht 787 z-...@us...-20090116155610-s9rvqacdyl4uu2ym 788 z-...@us...-20090116160116-47he0b9dhkvzfo8e 789 z-...@us...-20090116160130-yu0foyldpp0w651o 794 z-...@us...-20090119152329-7zjbhlxicmzrs3st 795 z-...@us...-20090119152406-eh33pwel5c1ev3tn 796 z-...@us...-20090124222920-5j301djumy6o30js 797 lee...@gm...-20090125161331-yk5t26dos9w7vqh3 798 lee...@gm...-20090125161412-uqkzofyzrzbw5fku 799 z-...@us...-20090125215052-nlr7n742el563xdo 801 z-...@us...-20090126114408-qusodq3le7x4cxmu 802 z-...@us...-20090126114433-hel0im4ncfqun48y 805 z-...@us...-20090126205856-miq23b488w0ybg08 806 z-...@us...-20090126213956-zvazq7x917mgwgcx 807 z-...@us...-20090127091358-zyxrvmeiem90y980 808 z-...@us...-20090127091531-1nu13tf1ylwyfeu2 809 z-...@us...-20090127091641-9ejvsyc3pnqwcquk 811 z-...@us...-20090127214457-3xlqb0gqbff5fzrp 812 z-...@us...-20090127215738-ef3azdi8gyejpmod 814 z-...@us...-20090128112925-ae2c03271u9dfxhw 815 z-...@us...-20090128120342-mbnkieilhllj4p4i 816 z-...@us...-20090128120737-3ln3obsj4d6tqn2a 818 lee...@gm...-20090131032714-zj324yiwx4wni02q 819 ep...@fr...-20090125161823-9dd0qka61mwcz3c1 820 ep...@fr...-20090131143119-vb7l6bbps0mq4nz0 821 wrt...@us...-20090131191353-72oxaevmd0c43bcd 822 wrt...@us...-20090131192158-su1i1fq7a22l8m4t 823 wrt...@us...-20090131202016-24mecfpuyglq88bm 824 lee...@gm...-20090201001131-102ieca1w2tgx88j 825 lee...@gm...-20090201001411-lgn4q6qa50huba5h 826 lee...@gm...-20090201005238-sbzpnl8po5nz4p0p 827 lee...@gm...-20090201005537-esbp0iuxn2wq9ngh 830 z-...@us...-20090202133840-7iwg1phjzr3uzssl 831 lee...@gm...-20090202152533-iya7luyiiaimmann 832 ep...@fr...-20090202212943-20822j01vxylgi1c 833 lee...@gm...-20090207183547-3l0rhwd4b1cb6ksi 837 lee...@gm...-20090212204958-7qcxyvg6gg25zjaj 841 z-...@us...-20090217081732-6jpvxz8o92sti37z 842 z-...@us...-20090217100425-q62s7uu2j4h9keq4 843 z-...@us...-20090217223904-w2fk3zhgjs0s0t55 844 z-...@us...-20090217224702-zs3dd362cll5szp7 845 z-...@us...-20090219175237-ynhe2ijn23bj3824 846 z-...@us...-20090221110006-fgbl1dk4q41b7x1f 848 z-...@us...-20090223100007-f7epfrh7lfmpv5t9 849 z-...@us...-20090224115230-pgv2rxw6412ndwcx 850 z-...@us...-20090224121247-g8ycdgh9m2dn6yth 854 wrt...@us...-20090227072038-tpfjivi0uhpgrl1a 856 z-...@us...-20090227114018-torvxxmcdpf66wwu 857 z-...@us...-20090227114224-sp0ihfus7xw2fcfv 858 z-...@us...-20090227122808-o2h53nb648qvcwb3 859 z-...@us...-20090227122836-k2jjl684gaico2p1 860 z-...@us...-20090227123920-flur7p6h2g24a0hm 861 z-...@us...-20090227143152-4nay9c5k5zzmdrr3 862 lee...@gm...-20090227182603-mo7djpl31xkh38bv 863 z-...@us...-20090227201048-rin598t8m9fctjf7 864 z-...@us...-20090227201140-fnx5r434n3urmz3i 865 z-...@us...-20090227204211-qwwrnbjkx3knmbko 866 z-...@us...-20090227204603-w8nle3nyd4r5ldng 867 z-...@us...-20090227205040-xqmbjcv8nxwt9t9z 868 z-...@us...-20090227205731-2m1v554bbt2qhxes 869 z-...@us...-20090227210145-bij5hlj5x82u461d 870 z-...@us...-20090227212539-wmt09xs5wb72jal9 871 z-...@us...-20090228191447-a5kgcgxger1uktqn Modified: armagetronad/trunk/armagetronad/src/network/nNetwork.cpp =================================================================== --- armagetronad/trunk/armagetronad/src/network/nNetwork.cpp 2009-02-27 21:55:11 UTC (rev 9084) +++ armagetronad/trunk/armagetronad/src/network/nNetwork.cpp 2009-02-28 20:37:58 UTC (rev 9085) @@ -853,13 +853,13 @@ { std::deque< unsigned short > & acks = sn_Connections[ peer ].acks_; - nProtoBufMessage< Network::Ack > * m = sn_ackDescriptor.CreateMessage(); + nProtoBufMessage< Network::Ack > * m = sn_ackDescriptor.CreateMessage(0); for( std::deque< unsigned short >::const_iterator i = acks.begin(); i != acks.end(); ++i ) { m->AccessProtoBuf().add_ack_ids( *i ); } - m->BendMessageID(0); + // m->BendMessageID(0); if( immediately ) { m->SendImmediately( peer, false ); @@ -1143,7 +1143,18 @@ #ifdef NET_DEBUG nMessages++; #endif - if ( !sn_readingFromPeer && !messageIDBig_ ) +} + +nMessageBase::nMessageBase( const nDescriptorBase & d ) +: descriptorID_( d.id ), + messageIDBig_( 0 ), + senderID_(::sn_myNetID) +{ +#ifdef NET_DEBUG + nMessages++; +#endif + + if ( !sn_readingFromPeer ) { current_id++; if ( ( current_id & 0xffff ) <= IDS_RESERVED ) Modified: armagetronad/trunk/armagetronad/src/network/nNetwork.h =================================================================== --- armagetronad/trunk/armagetronad/src/network/nNetwork.h 2009-02-27 21:55:11 UTC (rev 9084) +++ armagetronad/trunk/armagetronad/src/network/nNetwork.h 2009-02-28 20:37:58 UTC (rev 9085) @@ -499,8 +499,10 @@ messageIDBig_ = 0; } - explicit nMessageBase( const nDescriptorBase &, unsigned int messageID = 0 ); //!< create a new message with a given ID + nMessageBase( const nDescriptorBase &, unsigned int messageID ); //!< create a new message with a given ID + explicit nMessageBase( const nDescriptorBase & ); //!< create a new message with automatic ID + // immediately send the message WITHOUT the queue; dangerous! void SendImmediately(int peer,bool ack=true); Modified: armagetronad/trunk/armagetronad/src/network/nProtoBuf.cpp =================================================================== --- armagetronad/trunk/armagetronad/src/network/nProtoBuf.cpp 2009-02-27 21:55:11 UTC (rev 9084) +++ armagetronad/trunk/armagetronad/src/network/nProtoBuf.cpp 2009-02-28 20:37:58 UTC (rev 9085) @@ -174,6 +174,11 @@ nProtoBufMessageBase::~nProtoBufMessageBase(){} +nProtoBufMessageBase::nProtoBufMessageBase( nProtoBufDescriptorBase const & descriptor, unsigned int messageID ) +: nMessageBase( descriptor, messageID ), + streamer_( descriptor.GetStreamer() ) +{} + nProtoBufMessageBase::nProtoBufMessageBase( nProtoBufDescriptorBase const & descriptor ) : nMessageBase( descriptor ), streamer_( descriptor.GetStreamer() ) Modified: armagetronad/trunk/armagetronad/src/network/nProtoBuf.h =================================================================== --- armagetronad/trunk/armagetronad/src/network/nProtoBuf.h 2009-02-27 21:55:11 UTC (rev 9084) +++ armagetronad/trunk/armagetronad/src/network/nProtoBuf.h 2009-02-28 20:37:58 UTC (rev 9085) @@ -94,6 +94,7 @@ class nProtoBufMessageBase: public nMessageBase { public: + nProtoBufMessageBase( nProtoBufDescriptorBase const & descriptor, unsigned int messageID ); nProtoBufMessageBase( nProtoBufDescriptorBase const & descriptor ); ~nProtoBufMessageBase(); @@ -182,6 +183,12 @@ { } + nProtoBufMessage( nProtoBufDescriptor< PROTOBUF > const & descriptor, unsigned int messageID ) + : nProtoBufMessageBase( descriptor, messageID ) + , descriptor_( descriptor ) + { + } + //! returns the wrapped protcol buffer inline PROTOBUF const & GetProtoBuf() const { @@ -563,7 +570,7 @@ //! creates and schedules a message for broadcast (in client mode, that means just sending it to the server), returning the protovuf to fill PROTOBUF & Broadcast( bool ack = true ) { - nProtoBufMessage< PROTOBUF > * m = CreateMessage(); + nProtoBufMessage< PROTOBUF > * m = CreateMessageAuto( ack ); lastSent_ = m; m->BroadCast( ack ); return m->AccessProtoBuf(); @@ -572,7 +579,7 @@ //! creates and schedules a message for broadcast to all clients supporting a certain feature, returning the protobuf to fill PROTOBUF & Broadcast( nVersionFeature const & feature, bool ack = true ) { - nProtoBufMessage< PROTOBUF > * m = CreateMessage(); + nProtoBufMessage< PROTOBUF > * m = CreateMessageAuto( ack ); lastSent_ = m; m->BroadCast( feature, ack ); return m->AccessProtoBuf(); @@ -581,7 +588,7 @@ //! creates and schedules a message for sending to a specific peer, returning the protovuf to fill PROTOBUF & Send( unsigned int receiver, bool ack = true ) { - nProtoBufMessage< PROTOBUF > * m = CreateMessage(); + nProtoBufMessage< PROTOBUF > * m = CreateMessageAuto( ack ); lastSent_ = m; m->Send( receiver, 0, ack ); return m->AccessProtoBuf(); @@ -633,6 +640,24 @@ return tNEW(nProtoBufMessage< PROTOBUF >)( *this ); } + //! creates a message + inline nProtoBufMessage< PROTOBUF > * CreateMessage( unsigned int messageID ) const + { + return tNEW(nProtoBufMessage< PROTOBUF >)( *this, messageID ); + } + + //! creates a message + inline nProtoBufMessage< PROTOBUF > * CreateMessageAuto( bool ack ) const + { + if( ack ) + { + return CreateMessage(); + } + else + { + return CreateMessage(0); + } + } private: //! instance of this descriptor static nProtoBufDescriptor * instance_; Modified: armagetronad/trunk/armagetronad/src/network/nStreamMessage.cpp =================================================================== --- armagetronad/trunk/armagetronad/src/network/nStreamMessage.cpp 2009-02-27 21:55:11 UTC (rev 9084) +++ armagetronad/trunk/armagetronad/src/network/nStreamMessage.cpp 2009-02-28 20:37:58 UTC (rev 9085) @@ -98,6 +98,11 @@ { } +nStreamMessage::nStreamMessage( nStreamDescriptor const & descriptor ) +: nMessageBase( descriptor ), readOut(0), descriptor_( descriptor ) +{ +} + void nStreamMessage::OnRead( unsigned char const * & buffer, unsigned char const * end ) { nBinaryReader reader( buffer, end ); Modified: armagetronad/trunk/armagetronad/src/network/nStreamMessage.h =================================================================== --- armagetronad/trunk/armagetronad/src/network/nStreamMessage.h 2009-02-27 21:55:11 UTC (rev 9084) +++ armagetronad/trunk/armagetronad/src/network/nStreamMessage.h 2009-02-28 20:37:58 UTC (rev 9085) @@ -94,8 +94,10 @@ #endif } - explicit nStreamMessage( const nStreamDescriptor &, unsigned int messageID = 0 ); // create a new message + nStreamMessage( const nStreamDescriptor &, unsigned int messageID ); // create a new message + explicit nStreamMessage( const nStreamDescriptor & ); // create a new message + void Write(const unsigned short &x){ // can't write to a reading message, or one that was finalized tASSERT( 0 == readOut ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |